C Program to read radius of circle and calculate area and circumference

0
2
digitalample eye
Write a program to read radius of a circle and calculate area and circumference.
Write a c program to read radius of a circle and calculate area and circumference.

The value of PI : 3.14159

C Code

#include <stdio.h>
#include <conio.h>
#include <math.h>
void main()
{
float r, a, c;

printf("nEnter radius of a circle:");
scanf("%f",&r);

a = M_PI*r*r;
c = 2*M_PI*r;

printf("nArea of cicle = %f",a);
printf("nCircumference of circle = %f",c);

getch();
}

Output

radius of circle and calculate area and circumference

LEAVE A REPLY

Please enter your comment!
Please enter your name here