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
Last Updated :
28 Jun, 2021
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...