Untitled

mail@pastecode.io avatarunknown
plain_text
6 days ago
399 B
0
Indexable
Never
#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;
}