Question

The volume of sphere (40/30) * pi * r ^ 4 d therface area is 4.0pi...

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 )

Homework Answers

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

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions