
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
Surface Area and Volume of Hexagonal Prism in C programming
The surface area of any figure is the total area that it's surface cover.
A hexagonal prism is a three-dimensional figure that has a hexagon at both its ends. exam on prism looks like -
In mathematics, Hexagonal prism is defined as three dimensional figure with 8 faces, 18 edges, 12 vertices.
Surface Area = 3ah + 3√3*(a2) Volume = (3√3/2)a2h
Example
#include <stdio.h> #include<math.h> int main() { float a = 5, h = 10; //Logic to find the area of hexagonal prism float Area; Area = 6 * a * h + 3 * sqrt(3) * a * a; printf("Surface Area: %f
",Area); //Logic to find the Volume of hexagonal prism float Volume; Volume = 3 * sqrt(3) * a * a * h / 2; printf("Volume: %f
",Volume); return 0; }
Output
Surface Area: 429.903809 Volume: 649.519043
- Related Articles
- Program for Volume and Surface Area of Cube in C++
- Program for Volume and Surface Area of Cuboid in C++
- What is a Hexagonal prism?
- Program for Volume and Surface area of Frustum of Cone in C++
- How to find Volume and Surface Area of a Sphere using C#?
- How to find the Surface area and Volume of Cuboid in Golang?
- Java Program to Find the Surface area and Volume of Cuboid
- Swift Program to Find the Surface area and Volume of Cuboid
- Haskell Program to Find the Surface area and Volume of Cuboid
- Kotlin Program to Find the Surface Area and Volume of Cuboid
- How To Calculate Volume of Prism in Java?
- The surface area of a cube is 384 cm2. Find its volume.
- A solid cylinder has a total surface area of $231\ cm^2$. Its curved surface area is $\frac{2}{3}$ of the total surface area. Find the volume of the cylinder.
- What is the volume of equilateral triangular prism?
- Find the volume of a cube whose surface area is $384\ m^2$.

Advertisements