postfix and prefix : Arithmetic Operators « Operator « C# / CSharp Tutorial






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);
  }
}
2
1
1
1








3.2.Arithmetic Operators
3.2.1.Arithmetic Operators
3.2.2.shortcut Operators
3.2.3.postfix and prefix
3.2.4.Compound operator