C Programming

C- Read Radius of Circle, 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:");

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

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



Back to top button