In this article we will show you, How to write C Program to find Volume and Surface Area of a Cuboid with example. Before we step into the program, Let see the definitions and formulas behind Surface area of a Cuboid, Area of Top & Bottom Surfaces, Lateral Surface Area and Volume of a Cuboid

## Cuboid

Cuboid is a 3D object made up of 6 Rectangles. All the opposite faces (i.e Top and Bottom) are equal.

### Surface Area of a Cuboid

The Total Surface Area of a Cuboid is the sum of all the 6 rectangles areas present in the Cuboid. If we know the length, width and height of the Cuboid then we can calculate the Total Surface Area using the formula:

- Area of Top & Bottom Surfaces = lw + lw = 2lw
- Area of Front & Back Surfaces = lh + lh = 2lh
- Area of both sides = wh + wh = 2wh

The Total Surface Area of a Cuboid is the sum of all the 6 faces. So, we have to add all these area to calculate the final Surface Area

- Total Surface Area of a Cuboid = 2lw + 2lh + 2wh
- It is equal: Total Surface Area = 2 (lw + lh +wh)

### Volume of a Cuboid

The amount of space inside the Cuboid is called as Volume. If we know the length, width and height of the Cuboid then we can calculate the Volume using the formula:

- Volume of a Cuboid = Length * Breadth * Height
- Volume of a Cuboid = lbh
- The Lateral Surface Area of a Cuboid = 2h (l + w)

## C Program to find Volume and Surface Area of a Cuboid

This C program allows user to enter the length, width and height of a Cuboid. Using these values, compiler will calculate the Surface Area, Volume and Lateral Surface Area of Cuboid as per the formulas.

**CODE**

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
/* C Program to find Volume and Surface Area of a Cuboid */ #include <stdio.h> int main() { float length, width, height; float SA, Volume, LSA; printf("\nPlease Enter Length, Width and Height of a Cuboid\n"); scanf("%f %f %f",&length, &width, &height); SA = 2 * (length * width + length * height + width * height); Volume = length * width * height; LSA = 2 * height * (length + width); printf("\n The Surface Area of a Cuboid = %.2f\n",SA); printf("\n The Volume of a Cuboid = %.2f\n",Volume); printf("\n The Lateral Surface Area of a Cuboid = %.2f\n",LSA); return 0; } |

**OUTPUT**

**ANALYSIS**

In the above Example, We inserted Values Length = 8, Width = 5 and Height = 6

The Volume of a Cuboid for the Given Measures are:

Volume of a Cuboid = lbh = l * w * h

Volume of a Cuboid = length * width * height

Volume of a Cuboid = 8 * 5 * 6

Volume of a Cuboid = 240

The Volume of a Cuboid is 240

The Total Surface Area of a Cuboid for the Given Measures are:

Total Surface Area of a Cuboid = 2lw + 2lh + 2wh

Total Surface Area of a Cuboid = 2 (lw + lh +wh)

Total Surface Area of a Cuboid = 2*(length * width + length * height + width * height)

Total Surface Area of a Cuboid = 2 * ( (8 * 5) + (8 * 6) + (5 * 6) )

Total Surface Area of a Cuboid = 2 * (40 + 48 + 30)

Total Surface Area of a Cuboid = 2 * 118

Total Surface Area of a Cuboid = 236

The Total Surface Area of a Cuboid is 236

The Lateral Surface Area of a Cuboid for the Given Measures are:

Lateral Surface Area of a Cuboid = 2lh + 2wh

Lateral Surface Area of a Cuboid = 2h (l + w)

Lateral Surface Area of a Cuboid = 2 * height * (length + width)

Lateral Surface Area of a Cuboid = 2 * 6 * (8 + 5)

Lateral Surface Area of a Cuboid = 2 * 6 * (13 )

Lateral Surface Area of a Cuboid = 156

The Lateral Surface Area of a Cuboid is 156

Thank you for Visiting Our Blog

## Share your Feedback, or Code!!