shortcut Operators : Arithmetic Operators « Operator « C# / CSharp Tutorial






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








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