The volume of sphere (40/30) * pi * r ^ 4 d therface area is 4.0pi * r ^ 2 where is the radius the phone. Given the radius. design als mihim that computes the wolume ad surface area of the sphere Also using the c++ statements p ridend ou Exemple H write the statement w eg u drument in the allegorithm. You may aw =-3.1415s )
//C++ program
#include<iostream>
# define pi 3.1415
using namespace std;
double sphereVolume(double r){
return (4 * pi *(r*r*r))/3;
}
double sphereArea(double r){
return (4*pi*(r*r));
}
int main(){
double r;
cout<<"Enter radius of sphere : ";
cin>>r;
cout<<"Volume of sphere :
"<<sphereVolume(r)<<"\n";
cout<<"Surface Area :
"<<sphereArea(r)<<"\n";
return 0;
}
//sample output
Get Answers For Free
Most questions answered within 1 hours.