/******************************************************/ /* Introduction to Programming */ /* By Dr. ANTF */ /* www.antf.net */ /* Copyright 2015 */ /* */ /* C# 214 - Increment Decrement */ /******************************************************/ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DOS { class Program { static void Main(string[] args) { int x = 0, y; x++; y = x; Console.WriteLine("x = {0}, y = {1}", x, y); ++x; y = x; Console.WriteLine("x = {0}, y = {1}", x, y); y = x++; y = ++x; ++x; Console.WriteLine("x = {0}, y = {1}", x, y); Console.WriteLine("x = {0}, y = {1}", x++, y); Console.WriteLine("x = {0}, y = {1}", x, y); Console.WriteLine("x = {0}, y = {1}", ++x, y); Console.WriteLine("x = {0}, y = {1}", x, y); Console.ReadKey(); } } }