{"id":18020,"date":"2021-08-26T10:42:22","date_gmt":"2021-08-26T05:12:22","guid":{"rendered":"https:\/\/python-programs.com\/?p=18020"},"modified":"2021-11-22T18:37:13","modified_gmt":"2021-11-22T13:07:13","slug":"python-program-to-find-volume-and-surface-area-of-a-cuboid","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-find-volume-and-surface-area-of-a-cuboid\/","title":{"rendered":"Python Program to Find Volume and Surface Area of a Cuboid"},"content":{"rendered":"

In the previous article, we have discussed Python Program to Sort words in Alphabetic Order<\/a>
\nCuboid:<\/strong><\/p>\n

A Cuboid is a three-dimensional object made up of six Rectangles. All of the opposing faces (Top and Bottom) are the same.<\/p>\n

A Cuboid’s Surface Area :\u00a0<\/strong><\/p>\n

The Total Surface Area of a Cuboid is the sum of the areas of the Cuboid’s six rectangles. If we know the Cuboid’s length, width, and height<\/strong>, we can use the formula to calculate its Total Surface Area:<\/p>\n

Top and bottom surface area = lw + lw = 2lw<\/p>\n

Front and back surface area = lh + lh = 2lh<\/p>\n

Both sides’ area = wh + wh = 2wh<\/p>\n

A Cuboid’s Total Surface Area is the sum of its six faces. So, in order to calculate the final Surface Area, we must add all of these areas together.<\/p>\n

A Cuboid’s Total Surface Area = 2lw + 2lh + 2wh<\/p>\n

It is the same as:<\/p>\n

Formula for Surface Area of a cuboid = 2 (lw + lh + wh).<\/strong><\/p>\n

A Cuboid’s Volume :<\/strong>
\nVolume is the amount of space inside the Cuboid. If we know the Cuboid’s length, width, and height, we can use the following formula to calculate its volume:<\/p>\n

Cuboid Volume = Length * Breadth * Height<\/p>\n

A Cuboid’s Volume = lbh<\/p>\n

A Cuboid’s Lateral Surface Area = 2h (l + w).<\/p>\n

Given the length, width, and height <\/strong>of a cuboid, the task is to calculate the volume and surface of a given cuboid.<\/p>\n

Examples:<\/strong><\/p>\n

Example 1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given length = 1\r\nGiven width = 2\r\nGiven height = 3<\/pre>\n

Output:<\/strong><\/p>\n

The given surface Area of a Cuboid with given length,width,height[ 1 2 3 ]= 22.000\r\nThe given volume of a Cuboid with given length,width,height[ 1 2 3 ]= 6.000\r\nThe given lateral surface Area of a Cuboid with given length,width,height[ 1 2 3 ]= 18.000<\/pre>\n

Example 2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given length = 2.5\r\nGiven width = 5\r\nGiven height = 3<\/pre>\n

Output:<\/strong><\/p>\n

The given surface Area of a Cuboid with given length,width,height[ 2.5 5.0 3.0 ]= 70.000\r\nThe given volume of a Cuboid with given length,width,height[ 2.5 5.0 3.0 ]= 37.500\r\nThe given lateral surface Area of a Cuboid with given length,width,height[ 2.5 5.0 3.0 ]= 45.000<\/pre>\n

Program to Find Volume and Surface Area of a Cuboid<\/h2>\n

Below are the ways to calculate the volume and surface of a given cuboid.<\/p>\n