Search This Blog

Tuesday 4 December 2012

Interesting Tip: Increment, Decrement Operator:






Changing a variable by adding or subtracting 1 is so common that there is a special
shorthand for it,

x++  =>  x = x+1
x--   =>  x = x-1













You think you know about increment operator?
Lets see!
What will be its output?

Output:
5
5

Another Question:
Guess its output?

Output:
6
6
6


No comments:

Post a Comment