Question: 37. Given below is a user-defined function that returns the minimum of two numbers. On the line provided below, write the prototype statement for the
37. Given below is a user-defined function that returns the minimum of two numbers. On the line provided below, write the prototype statement for the function.
/********************************************************/ /* This function returns the smaller of two integers */ /********************************************************/ int min(int a, int b)
{ if(a < b)
return a; else
return b; }
________________________________________________________________________
38. On the line provided below, write a for statement that uses the following: Radians starts at 0.0, stops at 6.283, and is incremented by 0.349.
________________________________________________________________________
39. On the line provided below, write a while statement that uses the following: Temperature is above 50.0.
________________________________________________________________________
8
40. Convert the following if/else structure to a switch structure. (11 points)
/* if/else structure */ if(pressure == 45)
printf(" Exceeds safe limits - get out"); else { if(pressure == 30) printf(" Caution - monitor pressure"); else { if(pressure == 15) printf(" Turn on relief valves"); else printf(" Normal operating mode"); } }
. /* switch structure */
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
