Enter the radius r of the sphere to calculate the surface area and volume of the sphere. The result of the output is required to retain two decimal places.
Welcome Guest.
Enter the radius r of the sphere to calculate the surface area and volume of the sphere. The result of the output is required to retain two decimal places.
+2Votes
This is an entry level. There is no loop, no judgment. You should do it if you have learned C.
Main Program Reference
doube r; //Definition Radius
scanf("%f",&r); //Enter radius
s=4*3.14159*r*r; //surface area
v=4.0/3*3.14159*r*r*r; //volume
printf("%.2lf,%.2lf\n",s,v);