Sunday, February 16, 2020

Write a program to find area and circumference of a circle In C language

#include <stdio.h>
#include <stdlib.h>

void main()
{ float rad,area,circum;
printf("\n enter radius:    ");
scanf("%f",&rad);
printf("\n radius = %f",rad);
area = 22.0/7.0 * rad * rad;
circum = 2.0 * 22.0/7.0 * rad;
printf("\n area of a circle = %f", area);
printf("\n circumference of a circle = %f", circum);
getch();
}

output:

 enter radius:    10

 radius = 10.000000
 area of a circle = 314.285706
 circumference of a circle = 62.857143

No comments:

Post a Comment

python class topic video