Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A programmer was asned to write a program that calculates a conecv) given its radius (n) and its heightch) based on the formula The program
A programmer was asned to write a program that calculates a conecv) given its radius (n) and its heightch) based on the formula The program that made was the following: #include cstdio.h> #define PI 3.14 float Compute Volume (float rifloat wi int main (0 L float radius, heighti Printf ("Radius:"); scanf("%f", &radusli printf ("Height: scanf("%f", d heightli ans-ComputeVolume Cheight, Vadius); printf(Volume %fh, ans) return o float Compute Volume (float r, floath) flout ansi float vzi V2=8*r; anse (1.13.) *P1 * 2 *hi return=andi Unfortunately, despite the fact this program goes through the compiler Without errors it produces completely false results, - You are asuedi Li) To find and explain program. the errors of the above il Mane that the the necessary Changes (Where is needed) so above code worus correctly e) What modifications are needed to the above (corrected) program to produce the same results when we declare the function Compute Volume float ComputeVolume (float Ar, float xh)
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