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 19
Author : Mike Dane
Last Updated : November, 2017


Code

Copychar myGrade = 'A';
switch(myGrade){
     case 'A':
          cout << "You Pass" << endl;
          break;
     case 'F':
          cout << "You fail" << endl;
          break;
     default:
          cout << "Invalid grade" << endl;
}