print area of sphere not circle
This commit is contained in:
parent
b3554501ed
commit
cd1d50183b
2
C5/ex4.c
2
C5/ex4.c
@ -6,6 +6,6 @@ int main() {
|
|||||||
printf("Enter radius: ");
|
printf("Enter radius: ");
|
||||||
scanf("%f", &r);
|
scanf("%f", &r);
|
||||||
|
|
||||||
printf("Area of circle: %f\n", M_PI*r*r);
|
printf("Area of sphere: %f\n", 4.0*M_PI*r*r);
|
||||||
printf("Volume of sphere: %f\n", M_PI*r*r*r*4.0/3.0);
|
printf("Volume of sphere: %f\n", M_PI*r*r*r*4.0/3.0);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user