Engineering, Computer, Scholarship and SEO Support Forum

EDUCATION => Computer and I.T => Programming with C [MCQ] => Topic started by: mechanic on February 28, 2017, 07:15:56 AM

Title: The follwoing statement printf("&f", 9/5); prints [Programming with C)
Post by: mechanic on February 28, 2017, 07:15:56 AM
Question: The follwoing statement

printf("&f", 9/5);


prints

Options are:


A. 1.8
B. 1.0
C. 2.0
D. None of the above

Correct answer is:

D. None of the above


Explanation:


9/5 yields integer 1. Printing 1 as a floating point number prints garbage.