Question

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 )

Answer #1

//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

ADVERTISEMENT

Get Answers For Free

Most questions answered within 1 hours.

ADVERTISEMENT

asked 2 minutes ago

asked 3 minutes ago

asked 7 minutes ago

asked 19 minutes ago

asked 27 minutes ago

asked 30 minutes ago

asked 44 minutes ago

asked 55 minutes ago

asked 1 hour ago

asked 1 hour ago

asked 1 hour ago

asked 1 hour ago