C# - Programming Language
This course covers the basics of programming in C#. Work your way through the videos and we'll teach you everything you need to know to start your programming journey!

Switch Statements

Lesson 17
Author : Mike Dane
Last Updated : November, 2017


Code

Copychar myGrade = 'A';
switch(myGrade){
     case 'A':
          Console.WriteLine("You Pass");
          break;
     case 'F':
          Console.WriteLine("You fail");
          break;
     default:
          Console.WriteLine("Invalid grade");
}