Program to find volume and surface area of pentagonal prism | CPP program to find surface area and volume of the Pentagonal Prism ; function for surface area ; function for VOlume ; Driver function
#include <bits/stdc++.h> NEW_LINE using namespace std ; float surfaceArea ( float a , float b , float h ) { return 5 * a * b + 5 * b * h ; } float volume ( float b , float h ) { return ( 5 * b * h ) / 2 ; } int main ( ) { float a = 5 ; float b = 3 ; float h = 7 ; cout << " surface ▁ area = ▁ " << surfaceArea ( a , b , h ) << " , ▁ " ; cout << " volume = ▁ " << volume ( b , h ) ; }