C Programming Tutorial

Advertisements

Write program to calculate the area of circle using Cpp



       #include<iostream.h>
       #include<conio.h>

       void main()
       {
              int r;
              float area;
              clrscr();
              
              cout<<"\nEnter radius : "; 
              cin>>r;

              area = 3.14 * r * r;
              
              cout<<"\nThe area of circle is : "<<area;

              getch();
       }
       
   Output : 

              Enter radius : 5
              The area of circle is : 78.5




Advertisement