Answer to Question #21213 in C++ for DK

Question #21213
"Write a complete C++ program to find the Volume and the Surface Area of a Cylinder. The program should let the user enter Radius and Height of the cylinder. The user should always enter values which should be only numerical values. If a user has entered a value without an appropriate data type then appropriate error messages must be displayed. Hint: Use functions to write your program" help on this?
1
Expert's answer
2012-12-26T10:45:18-0500

//#include <stdafx>
#include <iostream>
using namespace std;


void vvv(int r,int h)
{
double V=0;

& V=3.14*r*r*h;

cout << "V= "<< V<< endl;
}

void sss(int r,int h)
{

double s=0;
s=2*2*3.14*r*r+2*3.14*r*h;

cout <<& "S= "<<s<< endl;
}

int main()
{
int digit;
cout << "Enter r and s: ";
int r,h;
cin >> r;
& cin >> h;

vvv(r,h);
& sss(r,h);
// system("pause");
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 the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS