Explanation
In this program, we have a cuboid with some length, width and height. We need to find its Surface Area.
A cuboid is a three-dimensional geometrical figure/container having six rectangular surfaces with the different sum of dimensions (length, width, and height) where every two opposite faces are of equal length width and height.
Formula
Surface Area Of Cuboid = 2lw + 2lh + 22hw = 2( lw + lh + hw ).
l is length, w is width and h is height.
Algorithm
- Define values for all dimensions.
- Use these values in the given formula.
- Print the Surface Area of Cuboid.
Complexity
O(1)
Input:
l= 2, w = 3, h = 5;
where l = length, w = width and h = height.
Output:
Surface Area OfCuboid = 2 * (l * w+ w * h + h * l)
= 2 * (2 * 3 + 3 * 5 + 5 * 2)
= 62.00000
Python
Output:
C
Output:
JAVA
Output:
C#
Output:
PHP
Output: