Question: Execute the below code on your machine: int money = 7 2 4 5 ; printf ( 1 . $ % . 2 1

Execute the below code on your machine: int money =7245; printf("1. $%.21f
", money /100.0); printf("2. $%.21f
"", money /( double)100); printf("3. $%.21f
",(double)money /100); int money =7245 printf("1. $%.21f
", money /100.0); printf("2. $%.21f
, money /(double)100); printf("3. $%.21f
,(double)money /100); Explain why these three examples work as intended. Apply terms like cast, promotion, coercion, implicit, and explicit in your answer. 3. Execute the following code on your machine: int result, money =7245; result = money /100 ; printf("1. $%.21f
, money /100); printf("2. $%d
"
, money /100); printf("3. $%.21f
", result); printf("4. $%d
, result); int result, money =7245; result = money /100; printf("1. $%.21f
"", money /100); printf ("2. $%d
", money /100); printf ("3. $%.21f
", result); printf("4. $%d
, result); Apply terms like cast, promotion, truncation, coercion, implicit, and explicit in answering the following questions. a) What is the value of the variable result? Explain why. b) What values are displayed for samples 1,2,3, and 4? c) What can you conclude about the printf function that causes samples 1 and 3 not to work as expected?

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!