Write a C program to accept radius of a circle and display the area and circumference of a circle.

#include<stdio.h>
#include<conio.h>
void main()
{
     int radius;
     float area, circumference;
     // Accept radius of circle
     printf("Enter the radius of cicle: ");
     scanf("%d",&radius);

     //calculate area and circumference of circle
     area=3.14*radius*radius;
     circumference=2*3.14*radius;
     
     //displaying area and circumference of circle
     printf("\nArea of circle is: %f",area);
     printf("\nCircumference of cirle is: %f",circumference);
}

0 Comments