Mega Code Archive

 
Categories / C# Tutorial / Operator
 

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