65 789
Assignments Done
99,4%
Successfully Done
In October 2018

Answer to Question #21709 in C++ for tilak dewangan

Question #21709
suitable program for switch case statement in c++
Expert's answer

#include <iostream>
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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions