Compute the volume of a cylinder) Write a program that reads in the radius and length of a cylinder and computes the area and volume using the following formulas:
area = radius * radius * π
volume = area * length
Start
Declare Real PI=3.14
Declare Real radius
Declare Real area
Declare Real volume
Declare Real length
Display "Enter the radius of a cylinder: "
Input radius
Display "Enter the length of a cylinder: "
Input length
Set area = radius * radius * PI
Set volume = area * length
Display "Area: ",area
Display "Volume: ",volume
Stop
Comments
Leave a comment