Here, we will read the height, width, length from the user. Then we will calculate the surface area, volume, and space diagonal of cuboids and print the result.
The surface area of cuboids:
A cuboid has 6 rectangular faces. To find the surface area of a cuboid, add the areas of all 6 faces. Consider that the length is l, width is w, and height is h of the prism and then the formula to calculate the Surface area of cuboids will be: 2lw + 2lh + 2hw
Volume of cuboids:
The formula to calculate the volume of cuboids (V) = whl
Space diagonal of cuboids: √(l2 + b2 +h2)
Program/Source Code:
The source code to calculate the surface area, volume, and space diagonal of cuboids is given below. The given program is compiled and executed successfully.
Output:
Explanation:
Here, we read the height, width, and length from the user. Then we calculated the surface area, volume, and space diagonal and printed the result.
need an explanation for this answer? contact us directly to get an explanation for this answer