Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A serious problem lies in the Compute volume function. Additionally, the programmer was confused about parameters and local variables. Make this function work correctly, and

image text in transcribed
A serious problem lies in the Compute volume function. Additionally, the programmer was confused about parameters and local variables. Make this function work correctly, and also improve its use of parameters, changing main as necessary. # include # define Pi E 3.14 float Compute Volume (float r, float h, float ans, float r2); int main () { float radius, height, ans, r2 printf ("radius :"); scant ("%g", &radius): printf ("Height : "); scant("% g" &height): ans = Compute Volume (radius, height, ans, r2); printf ("Volume:%g", ans); return (); } float Compute Volume (float r, float h, float ans, float r2) { r2 = r*r; ans = (1/3) * PIE * r2*h; return ans; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions