Untitled
unknown
plain_text
2 years ago
399 B
6
Indexable
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
float r;
printf("pls enter the radius of the circle:");
scanf("%f", &r);
if (r<=0){
printf("the radius must be a positive number");
} else {
printf("the perimeter of the circle is: %f", 2*M_PI*r);
printf("\nthe area of the circle is: %f", M_PI*r*r);
}
return 0;
}Editor is loading...