Home » Write a Program to find the Volume of a Hexagonal Prism

Write a Program to find the Volume of a Hexagonal Prism

by Online Tutorials Library

Write a Program to find the Volume of a Hexagonal Prism

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

What is Hexagonal Prism?

Hexagonal Prism is a 3-D shape, which has 8 faces, 12 vertices, and 18 edges.

Area of Hexagonal Prism

Program of calculating the Volume of a hexagonal prism in different Programming languages

Program 1: Write a Program in C language:

Output of Above C program:

Volume of the hexagonal prism  is: 489.458771  

Program 2: Write a Program in Java language:

Output of Above Java program:

The Volume of a hexagonal prism is:  10392.304845413264  

Program 3: Write a Program in PHP programming language.

Output of Above PHP program:

166.27687752661  

Program 4: Write a Program in Python programming language.

Output of Above Python program:

420.8883462392372  

You may also like