Write a program to compute the volume of a cylinder.your program reads the redius and length and computes using the formula
Area =radius *radius *pi
Volume =area =*length.
#include <iostream>
using namespace std;
int main()
{
double radius;
double length;
cout<<"\nEnter radius: ";
cin>>radius;
cout<<"\nEnter length: ";
cin>>length;
double pi=3.14285714286;
double area =radius *radius *pi;
double volume =area *length;
cout<<"\nVolume of the cylinder= "<<volume<<"\n";
return 0;
}
Comments
Leave a comment