Answer:
#include<iostream>
using namespace std;
int main(){
float radius,length;
float bottom_area, area, volume;
cout<<"Enter the value of Radius: ";
cin>>radius;
cout<<"\nEnter the value of length: ";
cin>>length;
bottom_area = radius * radius * 3.14;
area = bottom_area * length;
volume = (2 * radius * 3.14 * length) + (2 * bottom_area);
cout<<"Area is: "<<area<<endl;
cout<<"Volume is: "<<volume<<endl;
}
Explanation:
First include the library iostream for input/output.
then, initialize the variable radius and length.
cout is used to print the message or result on the screen
cin is used to store the value in the variable.
after that, by using the formula calculate the area and volume of cylinder.
the result is store in the area and volume variable.
Finally, print the result the output on the screen.
Note: All variables declare in the code is float type means you can enter the decimal value but you can enter the integer as well.