diameter and area of circle

#include<stdio.h>
int main() {
    float r,d,a,c;
    scanf("%f",&r);
    d=2*r;
    c=2*3.14*r;
    a=3.14*r*r;
    printf("diameter is %f:\n ",d);
       printf("circumferance is %f:\n ",c);
     printf("area is %f:\n ",a);
 
    return 0;
}


Input:
3.5
Output

diameter is 7.000000:
 circumferance is 21.980000:
 area is 38.465000:

No comments:

Post a Comment