Advertisement
daniv1

29.1

Oct 29th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. double S(double a)
  5. {
  6.     return a*a*sqrt(3.0)/4.0;
  7. }
  8.  
  9. double V(double a , double h)
  10. {
  11.     return 1.0*S(a)*h/3.0;
  12. }
  13. int main()
  14. {
  15.     double a = 0.0, h = 0.0;
  16.     printf("INPUT a\n");
  17.     scanf_s("%lf",&a);
  18.     printf("INPUT h\n");
  19.     scanf_s("%lf",&h);
  20.     printf("S = %g\n",S(a));
  21.     printf("V = %g\n",V(a,h));
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement