Advertisement
DarthLucius

Exercise1

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