;

Python Program to Calculate the Volume and Surface Area of Cuboid


Tutorialsrack 13/05/2020 Python

In this python program, we will learn how to calculate the volume and surface area of the cuboid. 

What is Cuboid?

A cuboid is a convex polyhedron bounded by six quadrilateral faces, whose polyhedral graph is the same as that of a cube. 

Formula

Here is the Source code of the program to calculate the volume and surface area of the cuboid. 

Python Program to Calculate the Volume and Surface Area of Cuboid
# Python Program to Calculate the Volume and Surface Area of Cuboid

# Take the input from the User
length = float(input("Enter the Length of a Cuboid: "))
width = float(input("Enter the Width of a Cuboid: "))
height = float(input("Enter the Height of a Cuboid: "))

# Calculate the Surface Area
SA = 2 * (length * width + length * height + width * height)

# Calculate the Volume
Volume = length * width * height

# Calculate the Lateral Surface Area
LSA = 2 * height * (length + width)

# Print the Output
print("\nThe Surface Area of a Cuboid = %.2f " %SA)
print("The Volume of a Cuboid = %.2f" %Volume);
print("The Lateral Surface Area of a Cuboid = %.2f " %LSA)
Output

Enter the Length of a Cuboid: 5

Enter the Width of a Cuboid: 6

Enter the Height of a Cuboid: 7

 

The Surface Area of a Cuboid = 214.00 

The Volume of a Cuboid = 210.00

The Lateral Surface Area of a Cuboid = 154.00 


Related Posts



Comments

Recent Posts
Tags