Question
Question 1) Please write an algorithm that will read the heightof a cylinder and radius of its base and print its volume andsurface area. The
Question 1) Please write an algorithm that will read the heightof a cylinder and radius of its base and print its volume andsurface area.
The volume of the cylinder is computed as h r2 ? (h=height,r=radius).
The surface area of the cylinder is 2?rh + 2?r2 (h=height,r=radius).
Question 2) Write a C-program that implements the algorithm inquestion 1. You should prompt the user to enter the height andradius and then compute and print the volume and surface area ofthe cylinder.
Sample run:
Please enter the height of the cylinder: 90
Please enter the radius of the base: 5
The volume of the cylinder is: 549.78
The surface area of the cylinder is: 376.99
Question 3) Write a C-program to compute the volume and surfacearea of N cylinders. Your program should read the height and radiusuntil the value –1 of the height is entered. The program shouldprint the volume and surface area of each entered cylinder.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started