Explanation
In this program, we have a cube with equal length, width, and height. We need to find its Surface Area.
A cube is a three-dimensional geometrical figure/container having all its surfaces with equal sides (length, breadth, and height). We have six equal square(surfaces).
Surface Area of Cube = 6 (Surface area of one Square)
Total Surface Area Of Cube = 6( side × side )
Formula
Surface Area Of Cube = 6( a × a )
a (side) = length=breadth=height
Algorithm
- Define equal value for all sides of cube.
- Use these values in the given formula.
- Print the Surface Area of Cube.
Complexity
O(1)
Surface Area Of Cube = 6 ( a * a )
Input:
b = 5, h = 5
a (side) = length = breadth = height
Output:
Surface Area Of Cube = 6 * 5 * 5=150.00000
Python
Output:
C
Output:
JAVA
Output:
C#
Output:
PHP
Output: