a + 1;
You meant:
a = a + 1;
// or
a += 1;
The expression a + 1
results in a value, but you have not assigned that value to anything (a
in particular).
solved Why is this printing 0? [closed]
a + 1;
You meant:
a = a + 1;
// or
a += 1;
The expression a + 1
results in a value, but you have not assigned that value to anything (a
in particular).
solved Why is this printing 0? [closed]