#include <iostream>
#include <string>
using namespace std;
void cylinder(float radius,float length,float& area,float& volume){
const float PI = 3.14159265359;
area=(2 * PI * radius * length );
volume= PI * radius * length;
}
int main() {
float radius, length, area,volume;
cout<<"Enter radius of the cylinder: ";
scanf("%f", &radius);
cout<<"Enter length of the cylinder: ";
scanf("%f", &length);
cylinder(radius,length,area,volume);
cout<<"Surface side surface area of the cylinder is "<<area<<"\n";
cout<<"Surface volume of the cylinder is "<<volume<<"\n";
cin>>radius;
return 0;
}
Comments
Leave a comment