Computer Applications
What will be the output of 'a' and 'b' in the expression b = a++, if int a, b; a=10?
- 10,10
- 10,11
- 11,10
- 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
int m,p; m=5; p=0; p= m-- + --m; The output will be:
- 11
- 10
- 8
- 12
int a=7, p=0, q=0;
p= ++a + --a;
q-=p;The output of q will be:
- 13
- 14
- 15
- -15
State whether the following statement is True or False :
Java is known as an Object-Oriented Programming (OOP) language.
State whether the following statement is True or False :
The comment line of the program is ignored during execution.