Advertisement
dimipan80

Calculate Sphere - Circumference, Surface, Volume

Jul 29th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main() {
  5.     double radius;
  6.     printf("Enter radius value: ");
  7.     scanf("%lf", &radius);
  8.  
  9.     double circumference = 2 * M_PI * radius;
  10.     double surface = 2 * circumference * radius;
  11.     double volume = surface * radius / 3;
  12.  
  13.     printf("circumference: %lf\nsurface: %lf\nvolume: %lf\n",
  14.            perimeter, surface, volume);
  15.  
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement