60 397
Assignments Done
98,1%
Successfully Done
In April 2018

Answer to Question #23079 in C++ for felix chimezie oguamanam

Question #23079
Write a program to calculate the surface area and volume of a cylinder using a macro
surface_area = 2 * Pi * r * (r + h)
Volume = Pi * r * r * h
Expert's answer
#include <iostream>
#include <math.h>

using namespace std;

int main()
{
cout << "enter r and h" << endl;
double r;
cin>>r;
cout<<endl;
double h;
cin>>h;
double Pi=3.14;

double surface_area = 2*Pi*r*(r+h);
double Volume = Pi*r*r*h;

cout<<"surface_area= "<<surface_area<<endl;
cout<<"Volume= "<<Volume<<endl;

return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions