Mega Code Archive

 
Categories / C# Tutorial / Data Type
 

Comparing the Prefix and Postfix Increment Operators

class IncrementExample {   public static void Main()   {       int x;       x = 1;       System.Console.WriteLine("{0}, {1}, {2}", x++, x++, x);       System.Console.WriteLine("{0}, {1}, {2}", ++x, ++x, x);   } }