Home » Write a program to find the Area of the Rectangular Prism

Write a program to find the Area of the Rectangular Prism

by Online Tutorials Library

Write a program to find the Area of the Rectangular Prism

Before writing the program of calculating the area of a rectangular prism in different programming languages, firstly we have to know about the rectangular prism and its area’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.

Area of Rectangular Prism

To calculate the surface area of rectangular prism, first we have to use the following formula:

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

Program 1: Write a Program in C language:

Output of Above C program:

Surface area of the rectangular prism  is: 355.809998  

Program 2: Write a Program in Java language:

Output of Above Java program:

Surface area of the rectangular prism  is: 355.809998  

Program 3: Write a Program in PHP programming language.

Output of Above PHP program:

355.81  

Program 4: Write a Program in Python programming language.

Output of Above Python program:

432  

You may also like