Monday, July 2, 2018

5. WAP to calculate Area and Circumference of a circle.

#include<stdio.h>
#include<conio.h>
void main()
{
   const float pi=3.14;
   int r;
   float ar,c;
   r=5;
   ar=pi*r*r;
   c=2*pi*r;
   printf("Radius = %dcm",r);
   printf("\nArea = %.2fsq. cm",ar);
   printf("\nCircumference = %.2fcm",c);
   getch();
}


OUTPUT:




Please have a look at the below video lesson posted on my YouTube channel:



No comments:

Post a Comment