0
Who can teach me increment and decrement operators?
I can't understand that subject.
5 ответов
+ 3
Increment operators are of two types : Postfix and Prefix operators.
Postfix : a++, the variable a is increased by 1 after using it once.
Prefix : ++a, the variable a is increased after using it.
Decrement operators too are of the same two types.
Postfix : a--, the variable a is decreased by 1 after using it once.
Prefix: --a, the variable a is decreased by 1 before using it.
+ 1
Thank you Karan Kumar. I understand, I have gor one more question. How you can estimate a++ or ++a?
+ 1
In a++ the value is increased afterwards while in ++a the value is increased before using it.
+ 1
You will get to know the estimation once you start practicing it.
Most preferably via looping.
Best of luck.
Keep coding