Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- double S(double a)
- {
- return a*a*sqrt(3.0)/4.0;
- }
- double V(double a , double h)
- {
- return 1.0*S(a)*h/3.0;
- }
- int main()
- {
- double a = 0.0, h = 0.0;
- printf("INPUT a\n");
- scanf_s("%lf",&a);
- printf("INPUT h\n");
- scanf_s("%lf",&h);
- printf("S = %g\n",S(a));
- printf("V = %g\n",V(a,h));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement