Professional Documents
Culture Documents
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
double Area,Volume;
float r,h;
cout<<"This program will calculate the area of a circle "<<endl;
cout<<"and the volume of a cylinder"<<endl<<endl;
cout<<"Please enter the radius of a circle"<<endl;
cin>>r;
cout<<endl;
cout<<"Please enter the height of a cylinder"<<endl;
cin>>h;
Area=3.142*r*r;
Volume=3.142*r*r*h;
cout<<"Area of the circle is "<<Area<<endl;
cout<<"Volume of the cylinder is "<<Volume<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
Pseoducode :
Start
Insert r and h
Area= 3.142 x r x r
Volume= 3.142 x r x r x h
Print Area and volume
End
QUESTION 6-TUTORIAL 2
TUTORIAL 2- QUESTION 12
#include <cstdlib>
#include <iostream>
using namespace std;