/******************************************************/ /* Introduction to Programming */ /* By Dr. ANTF */ /* www.antf.net */ /* Copyright 2015 */ /* */ /* C# 213 - switch */ /******************************************************/ 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 = 3; if (x == 0) Console.WriteLine("First Choice"); else if (x == 1) Console.WriteLine("Second Choice"); else if (x == 2) Console.WriteLine("Third Choice"); else if (x == 3) Console.WriteLine("Fourth Choice"); else Console.WriteLine("Last Choice"); switch(x) { case 0: Console.WriteLine("First Choice"); break; case 1: Console.WriteLine("Second Choice"); break; case 2: Console.WriteLine("Third Choice"); break; case 3: Console.WriteLine("Fourth Choice"); break; default: Console.WriteLine("Last Choice"); break; } Console.ReadKey(); } } }