Question: Use the below code

Use the below code

1. #include

using namespace std;

int main () {

// local variable declaration

char grade = 'D';

switch(grade) {

case 'A' :

cout << "Excellent!" endl;

break;

case 'B' :

case 'C' :

cout << "Well done" << endl;

break;

case 'D' ;

cout << "You passed" << endl;

break;

case 'F' :

cout << "Better try again" << endl;

break;

default :

cout << "Invalid grade" << endl;

}

cout << "Your grade is " << grade << endl;

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!