In this python basic program, we will calculate the area of the cylinder using the formula 2*PI*r*h + 2*PI*r*r.
Steps to solve the program
- Take the radius and height of the cylinder as input through the user.
- Calculate the area of the cylinder using the formula: 2*PI*r*h + 2*PI*r*r, where h is the height and r is the radius of the cylinder.
- Print the output.
r = int(input("Enter radius of cylinder: "))
h = int(input("Enter height of cylinder: "))
area = 2*3.14*r*h+2*3.14*r*r
print("Area of cylinder: ",area)
Output :
Enter radius of cylinder: 4
Enter height of cylinder: 5
Area of cylinder: 226.08