Solution:
In programming, the ++ and -- are known as increment and decrement.
Suppose you declare a variable named var and put the ++ & -- sign as following:
var++ ------ This is post-increment
++var ------ This is pre-increment
var-- ------ This is post-decrement and
--var ------ This is pre-decrement
In your program, you must be getting the value of n
5
6
It means the post-increment adding your number by 1 on the first line and then it reduced by 1 because of the post-decrement operator.
I hope you get it clearly.