postfix and prefix : Arithmetic Operators : Operator C# Examples


C# Examples » Operator » Arithmetic Operators »

 

postfix and prefix









    
using  System;

class  MainClass
{
    static  void  Main(string[]  args)
    {
        int      a,b,c,d,e,f;

        a  =  1;            

        b  =  a  +  1;        
        b  =  b  -  1;        

        c  =  1;  d  =  2;    
        ++c;            
        Console.WriteLine(c);
        --d;            
                Console.WriteLine(d);
                
        e  =  --c;        
        Console.WriteLine(e);
        f  =  c--;        
        Console.WriteLine(f);
    }
}
    
   
  
   



Output

2
1
1
1


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Operator
» Arithmetic Operators