postfix increment : Prefix Postfix Operator : Operator C# Examples


C# Examples » Operator » Prefix Postfix Operator »

 

postfix increment









    
class  MainClass
{

    public  static  void  Main()
    {

        int  length  =  3;
        int  newLength  =  length++;
        System.Console.WriteLine("Postfix  increment  example");
        System.Console.WriteLine("length  =  "  +  length);
        System.Console.WriteLine("newLength  =  "  +  newLength);

    }

}
    
   
  
   



Output

Postfix increment example
length = 4
newLength = 3


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Operator
» Prefix Postfix Operator