
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CSTest_switch { class Program { static void Main(string[] args) { int btn; btn = 2; switch (btn) { case 1: Console.WriteLine("btn이 1일 경우"); break; case 2: Console.WriteLine("btn이 2일 경우"); break; case 3: Console.WriteLine("btn이 3일 경우"); break; default : Console.WriteLine("btn이 1,2,3이 아닐 경우"); break; } } } } | cs |
'C# > C# Concept' 카테고리의 다른 글
[C#] 메소드 오버로딩 (0) | 2018.03.15 |
---|---|
[C#] While for문 변환과 , do while (0) | 2018.03.15 |
[C#] IF 문 (0) | 2018.03.15 |
[C#] Button (0) | 2018.03.14 |
[C#] partial 클래스 (0) | 2018.03.14 |