increment operator increments the variable by 1 at a time and decrement operator decrements by 1 in this we have two types increments pre_increment and post increment.
In pre_increment the original value is incremented by 1 and assign the new value
n=10
i=++n
then i =11
In post increment the original value is assigned and after it increments value by 1.
n=10
i=n++
then i=10
example:
k=5
i=k++ + ++k
i=?
ans:
in first k++ value is 5
second ++k value is 7
i=5+7=12
Copyright © 2026 eLLeNow.com All Rights Reserved.