37. Given below is a user-defined function that returns the minimum of two numbe
ID: 3822873 • Letter: 3
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 function.
{
if(a < b)
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)
} }
Explanation / Answer
Question 37:
#include <stdio.h>
// protoType
int min(int a, int b);
int main()
{
int result = min(10,20);
printf("The resutl is %d ",result);
return 0;
}
int min(int a, int b)
{
if(a < b)
return a;
else
return b; }
Question 38:
you can achive using for loop
for(radians = 0.0 ; radians < 6.283 ; radians = radians + 0.349);
Question 39:
while(temp > 50.0)
{
// some code
}
Question 39:
switch(pressure)
{
case 45:
printf(" Exceeds safe limits - get out");
break;
case 30:
printf(" Caution - monitor pressure");
break;
case 15:
printf(" Turn on relief valves");
break;
default :
printf(" Normal operating mode");
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.