175k views
0 votes
Write the code to read 3 input values for the length, height and width of a cuboid, then calculate the area and circumference.

User Glaand
by
4.1k points

1 Answer

6 votes

Answer:

length = float(input("Enter the length: "))

height = float(input("Enter the height: "))

width = float(input("Enter the width: "))

area = 2 * (length * height + height * width + width * length)

circumference = 4 * (length + height + width)

print("The area is: " + str(area))

print("The circumference is: " + str(circumference))

Step-by-step explanation:

*The code is in Python.

Ask the user to enter the length, height and width

Calculate the area and circumference using the formulas and print them

User Nishan
by
4.5k points