GATE | GATE-CS-2004 | Question 28



What is the result of evaluating the following two expressions using three-digit floating point arithmetic with rounding?

(113. + -111.) + 7.51
113. + (-111. + 7.51) 

(A) 9.51 and 10.0 respectively
(B) 10.0 and 9.51 respectively
(C) 9.51 and 9.51 respectively
(D) 10.0 and 10.0 respectively


Answer: (A)

Explanation:

(113. + -111.) + 7.51 
= 2 + 7.51 
= 9.51


113. + (-111. + 7.51) 
= 113. + (-111. + 7.51) 
= 113. - 103. = 10 [103.49 is rounded to 103.0]


Quiz of this Question



My Personal Notes arrow_drop_up

Article Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.