Sunday, June 8, 2014

C++ Beginners Tutorial 7 - Switch Statement

10:28 AM



#include <iostream>
using namespace std;
int main()
{
char grade;
cout<<"Please Enter the grade"<<endl;
cin>>grade;

switch(grade)
{
case 'a':
case 'A' : cout<<"Excellent"<<endl;
break;
case 'B' : cout<<"Very Good"<<endl;
break;
case 'C' : cout<<"You Passed"<<endl;
break;
default:
cout<<"Invalid Entry"<<endl;
break;

}
return 0;
}

Written by

We are one of the initiators of the development of information technology in understanding the need for a solution that is familiar and close to us.

0 comments:

Post a Comment

 

© 2013 Klick Dev. All rights resevered.

Back To Top