What will be the output of a + + when int a=-1
Answers
Answered by
0
Answer:
a = -1
a++
⇒ a = -1 and then increment a
a = a + 1 = -1+1 = 0
Explanation:
if you return a++ or print a++.
⇒ the value of a++ is -1.
but if you would use for other purpose. Let's say
a = -1;
a++;
y = a + 4; // here a = 0.
Similar questions
Math,
1 month ago
Social Sciences,
1 month ago
History,
4 months ago
Hindi,
10 months ago
Math,
10 months ago