Question: 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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!