class Program { static void Main(string[] args) { int number = 0; if (number > 20) { Console.WriteLine("Number is greater than 20."); } else if (number < 20) { Console.WriteLine("Number is less than 20."); } else { Console.WriteLine("Number is equal to 20."); } // Switch - case string text = "C#"; string textConcat = "C#" + "VB.NET"; Console.WriteLine(textConcat); // Output : C#VB.NET switch (text) { case "VB.NET": case "C#": { Console.WriteLine(".NET Compliant Language."); break; } case "Java": { Console.WriteLine("Java"); break; } default: { Console.WriteLine("What is this?"); break; } } // 삼항 연산자. (Conditional Statement) bool isJava = (text == "Java") ? true : false; // While loop int loop = 5; while (loop > 0) { Console.WriteLine("While Loop!"); loop--; } loop = 5; // do-while loop do { Console.WriteLine("Do-While Loop!"); loop--; } while (loop > 0); // for-loop for (int i = 0; i < 40; i++) { Console.WriteLine("For loop!"); } // foreach int[] arr = new int[] { 0, 1, 2, 3 }; foreach (int item in arr) { Console.WriteLine(item); } // multi-dimension array int[,] twoDimArray = new int[2, 3]; twoDimArray[0, 2] = 10; int num = twoDimArray[0, 1]; } }