C Programming Tutorial

Advertisements

Write program to calculate the area of circle using C



       #include<stdio.h>
       #include<conio.h>
       void main()
       {

              int r;
              float area;
              clrscr();
              
              printf("\nEnter radius : "); 
              scanf("%d",&r);

              area = 3.14 * r * r;
              
              printf("\nThe area of circle is : %f",area);

       }
       
   Output : 

              Enter radius : 5
              The area of circle is : 78.5




Advertisement