Percentage change in Hemisphere volume if radius is changed | C ++ program to find percentage change in hemisphere volume wrt change in radius ; Function to find the change in hemispheric volume ; Driver code ; Get the change in radius ; Calculate the change in hemispheric volume
#include <iostream> NEW_LINE #include <math.h> NEW_LINE using namespace std ; void new_vol ( double x ) { if ( x > 0 ) { cout << " % ▁ change ▁ in ▁ the ▁ " << " volume ▁ of ▁ the ▁ hemisphere : ▁ " << pow ( x , 3 ) / 10000 + 3 * x + ( 3 * pow ( x , 2 ) ) / 100 << " % " << " ▁ increase STRNEWLINE " ; } else if ( x < 0 ) { cout << " % ▁ change ▁ in ▁ the ▁ " << " volume ▁ of ▁ the ▁ hemisphere : ▁ " << pow ( x , 3 ) / 10000 + 3 * x + ( 3 * pow ( x , 2 ) ) / 100 << " % ▁ decrease STRNEWLINE " ; } else { cout << " Volume ▁ remains ▁ the ▁ same . " ; } } int main ( ) { double x = -10.0 ; new_vol ( x ) ; return 0 ; }