Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Written in C, thanks 1. (50 points) Write a program that reads the values for the radius and height of a solid cylinder using two
Written in C, thanks
1. (50 points) Write a program that reads the values for the radius and height of a solid cylinder using two variables of type double, and then calculates the surface area and volume of the cylinder. The program should include the following function. Do not modify the function prototype. void area_volume (double radius, double height, double *pointer_area, double *pointer_volume); The function takes two parameters of double type for the radius and height of the cylinder. The pointer_area parameter points to a variable in which the function will store the area of the circle. The pointer_volume parameter points to a variable in which the function will store the volume of the cylinder. 1) Name your program cylinder.c 2) The main function should ask the user to enter the radius of the cylinder and call the area_volume function to calculate the area and volume. 3) The area volume function does NOT print the area, volume, or anything else. The area and volume of the cylinder passed back from the two pointer arguments pointer_area and pointer volume are printed out in the main function 4) The main function should contain the printf statements that display the area and volume with three decimal digits. Example input/output: Enter the radius of the cylinder: 3.4 Enter the height of the cylinder: 8.2 Output: The volume of the cylinder is 297.798 and the area is 247.809Step 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