Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. #include <stdio.h>
  2. float VBOX();
  3. float SBOX();
  4. //float VSPHERE();
  5. int main(){
  6. float L,W,H,Vb,Sb;
  7.  
  8. printf("\nEnter a value for W: ",W);
  9. scanf_s("%f",&W);
  10.  
  11. printf("\nEnter a value for L: ",L);
  12. scanf_s("%f",&L);
  13.  
  14. printf("\nEnter a value for H: ",H);
  15. scanf_s("%f",&H);
  16.  
  17. Vb = VBOX(W,L,H);
  18. printf("\nThe volume of the box is: %.2f\n",Vb);
  19.  
  20. Sb = SBOX(W,L,H);
  21. printf("\nThe surface area of the box is: %.2f\n",Sb);
  22. // printf("\nThe volume of the sphere of %f",VS);
  23. }
  24. float VBOX(float W, float L, float H){
  25. float Vb;
  26. Vb=W*L*H;
  27. return Vb;
  28. }
  29. float SBOX(float W, float L, float H){
  30. float Sb;
  31. Sb=2*(W*L+W*H+L*H);
  32. return Sb;
  33. }
  34. //float VSPHERE(){
  35. // float W,L,H,R,VS;
  36. // VS=(4/3)*pi*(R*R*R)
  37. // return VS;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement