C program to calculate circumference and area of circle

C program to calculate circumference and area of circle:
If you are using any software then below program will not give an error, but if you are using TURBO C then you have to make some changes like: void main() and some function like clrscr() or getch().

#include<stdio.h>
 main()
 {

   int ra;
   float PI=3.14,area,ci;

   printf("Enter radius of circle: ");
   scanf("%d",&ra);

   area=PI*ra*ra;
   printf("\nArea of circle : %f ",area);

   ci=2*PI*ra;
   printf("\nCircumference : %f ",ci);
}

OUTPUT:

Enter radius of circle: 7

Area of circle : 153.860001
Circumference : 43.960003

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.