The increment operator is used to increase an integer‘s value one by one, and is a commonly used C# operator.

The Code:

New Project112

The Output of Your Code:

New Project113.png

 

Prefix & Postfix Forms

 

These changes to the position of the operator with respect to the operands create two new expression formats, prefix and postfix.

++x;// prefix

x++;// postfix

Prefix increments the value, and then proceeds with the expression.
Postfix evaluates the expression and then performs the incrementing

Prefix:

New Project114

The Output of Your Code:

New Project115.png

Postfix:

New Project117

The Output of Your Code:

New Project116

if_Audio_-_Video_-_Game_26_2298369 (1)   if_Audio_-_Video_-_Game_27_2298366 (1)

Leave a comment