Consider the program below. WHAT IS THE OUTPUT of the program for the following
ID: 3819087 • Letter: C
Question
Consider the program below. WHAT IS THE OUTPUT of the program for the following inputs? (You DON'T need to show the output of the prompt message.) If you are not confident of an answer, type in, compile and run the program. #include #include int main () {/* main */float input_value; printf ("Input a real number: ''); scanf("%f", &input;_value); printf("fabs(%5.2f) = %5.2f ", input_value, fabs(input_value)); printf(" squareroot (fabs(%5.2f)) = %5.2f ", input_value, squareroot (fabs(input_value))); printf("rint (%5.2f) = %5.2f ", input_value, rint(input_value)); printf("rint(fabs(%5.2f)) = %5.2f ", input_value, rint(fabs(input_value))); printf("floor (%5.2f) = %5.2f ", input_value, floor(input_value)); printf("floor(fabs(%5.2f)) = %5.2f ", input_value, floor(fabs(input_value))); printf("ceil (%5.2f) = %5.2f ", input_value, ceil(input_value)); printf("ceil(fabs(%5.2f)) = %5.2f ", input_value, ceil(fabs(input_value)));}/* main */(a) 5.25 (b) -5.25 (c) 5.75 (d) -5.75Explanation / Answer
About the answers given in the problem above,i am not sure about that.
After i have compiled the program i got the result as below.
input a real number:
fabs( 2.16) = 2.16
sqrt(fabs( 2.16)) = 1.47
rint( 2.16) = 2.00
rint(fabs( 2.16)) = 2.00
floor( 2.16) = 2.00
floor(fabs( 2.16)) = 2.00
ceil( 2.16) = 3.00
ceil(fabs( 2.16)) = 3.00
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.