Computer Applications

What will be the output of 'a' and 'b' in the expression b = a++, if int a, b; a=10?

  1. 10,10
  2. 10,11
  3. 11,10
  4. 11,11

Java Operators

127 Likes

Answer

11,10

Reason — The given expression will result in b=10 and a=11 as the postfix operator will first use the value and then increment it. So, the output of a and b will be 11, 10.

Answered By

25 Likes


Related Questions