Program to find Surface Area and Volume of Octagonal Prism | C ++ program to find the Surface area and volume of octagonal prism ; Function to find the Volume of octagonal prism ; Formula to calculate volume = ( area * h ) ; Display volume ; Function to find the surface area of octagonal prism ; Formula to calculate Surface area ; Driver Code
#include <iostream> NEW_LINE using namespace std ; void find_volume ( float area , float h ) { float Volume = ( area * h ) ; cout << " Volume : ▁ " << Volume << endl ; } void find_Surface_area ( float area , float a , float h ) { float Surface_area = ( 2 * area ) + ( 8 * a * h ) ; cout << " Surface ▁ area : ▁ " << Surface_area << endl ; } int main ( ) { float h = 1 ; float a = 6 ; float d = 2 ; float area = 2 * a * d ; find_Surface_area ( area , a , h ) ; find_volume ( area , h ) ; return 0 ; }