Computer Science, asked by mkumar623, 4 months ago

What will be the output of a + + when int a=-1

Answers

Answered by profdambaldor
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