Perimeter of circle (C) = 2*pi*r
Area of circle (A) = pi*r*r
#include<stdio.h>
void main()
{
int r;
float pi=3.14, c, a;
printf("Enter radius of circle");
scanf("%d", &r);
if(r>5)
{
c = 2*pi*r;
printf("Circumference of circle = %f", c);
}
else
{
a = pi*r*r ;
printf("Area of circle = %f", a);
}
}
0 Comments