DarthLucius

Exercise2

Jun 12th, 2022 (edited)
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <math.h>
  3. static float pi = atan(1)*4;
  4. int main(){
  5.     float r, v, s;
  6.     printf("Radius: ");
  7.     scanf("%f", &r);
  8.     s = 4 * pi * pow(r, 2); // sahe
  9.     v = (3 * pi * pow(r, 3))/4; // hecm
  10.     printf("Area: %f", s);
  11.     printf("\nVolume: %f\n", v);
  12.     system("pause");
  13. }
  14.  
Add Comment
Please, Sign In to add comment