Welcome Guest.

1Answers

C language ball problem

Asked by: Laura Harrison 236 views IT November 29, 2018

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.

1 Answers

  1. +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);

    Laura Hughes- November 29, 2018 |