Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. //drndf
  2. #include <cstdio>
  3. #include <iostream>
  4. #include <cmath>
  5.  
  6. int main()
  7. {
  8.     double R;
  9.     double H;
  10.     printf("Enter \"r\":");
  11.     std::cin>>R;
  12.     printf("Enter \"h\":");
  13.     std::cin>>H;
  14.    
  15.     double b=M_PI*R*R;
  16.     double S=(2*M_PI*R*H)+(2*b);
  17.     double V=b*H;
  18.    
  19.     printf("Result: S=%g V=%g", S, V);
  20.    
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement