Before writing the program of calculating the area of a pentagonal prism in different programming languages, firstly we have to know about the pentagonal prism and its area's formula.
What is Pentagonal Prism?
Pentagonal Prism is a 3-D shape, which has 7 faces, 10 vertices, and 15 edges. A pentagonal prism can have pentagonal bases which give five sides. A pentagonal prism is also known as five-sided polygon prism.
Area of Pentagonal Prism
Surface area of Pentagonal Prism = 5 * a * b + 5 * b * h
Where, b is the base length, a is length and h is the height of the pentagonal prism.
Program of calculating the area of a pentagonal prism in different Programming languages
Program 1: Write a Program in C language:
Output of Above C program:
Program 2: Write a Program in Java language:
Output of Above Java program:
Program 3: Write a Program in PHP programming language.
Output of Above PHP program:
Program 4: Write a Program in Python programming language.
Output of Above Python program: