Thursday, 11 February 2016

Evaluate the following expressions as C++ would:

Leave a Comment
Evaluate the following expressions as C++ would:
          a. 8 * 9 + 2
          b. 6 * 3 / 4
          c. 3 / 4 * 6
          d. 6.0 * 3 / 4
          e. 15 % 4

Ans:

a. 8 * 9 + 2 is 72 + 2 is 74

b. 6 * 3 / 4 is 18 / 4 is 4

c. 3 / 4 * 6 is 0 * 6 is 0

d. 6.0 * 3 / 4 is 18.0 / 4 is 4.5

e. 15 % 4 is 3


Reference:

Answers to Chapter Reviews C++ Primer Plus

If You Enjoyed This, Take 5 Seconds To Share It