Write a program to find the Volume of the Rectangular Prism

Before writing the program of calculating the volume of a rectangular prism in different programming languages, firstly we have to know about the rectangular prism and its volume's formula.

What is Rectangular Prism?

Rectangular Prism is a 3-D shape, which has six faces, 8 vertices, and 12 edges. This object is similar to cuboids. All the faces of this shape are rectangle.

Volume of Rectangular Prism

To calculate the volume of rectangular prism, we have to use the following formula:

Program of calculating the volume of a rectangular prism in different Programming languages

Program 1: Write a Program in C language:

Output of Above C program:

Volume of the rectangular prism is: 414.050018

Program 2: Write a Program in Java language:

Output of Above Java program:

The volume of a rectangular prism is:
540.0

Program 3: Write a Program in PHP programming language.

Output of Above PHP program:

414.05

Program 4: Write a Program in Python programming language.

Output of Above Python program:

320

Next TopicPrograms List




Latest Courses