shortcut Operators : Arithmetic Operators : Operator C# Examples


C# Examples » Operator » Arithmetic Operators »

 

shortcut Operators









    
using  System;

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

        a  =  1;
        a  +=  1;
        Console.WriteLine(a);
        b  =  a;
        b  -=  2;
        Console.WriteLine(b);
        c  =  b;
        c  *=  3;
        Console.WriteLine(c);
        d  =  4;
        d  /=  2;
        Console.WriteLine(d);
        e  =  23;
        e  %=  3;
        Console.WriteLine(e);
    }
}
    
   
  
   



Output

2
0
0
2
2


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Operator
» Arithmetic Operators