Main menu

Media Coverage

<div class="small-4 columns">media 1</div>

<div class="small-4 columns">media 2</div>

<div class="small-4 columns">media 3</div>

Reach to Us

Post & Pre Increment Operators

Post & Pre Increment Operators

Increment and Decrement operators are two unary operators which respectively increases or decreases 1 from a variable. When an increment(or decrement) operator is appended after a variable it acts as Post-increment (or Post-decrement) operator, and when it is appended before a variable, it acts as Pre-increment (or Pre-decrement) operator. Post-increment (or Post-decrement) operator increases (or decreases) the value of the variable by one, but the resultant of the expression remains the previous value only, not the modified one. However, Pre-increment (or Pre-decrement) operator increases (or decreases) the value of the variable by one, and this modified value is replected in the resultant of the expression as well.

p = count++;

is equivalent to executing the following two statements.

p = count;
count = count + 1;

On the other hand,

p = ++count;

is equivalent to executing the following two statements.

count = count + 1;
p = count;

Contributor's Info

Created:
0Comment