I am writing a switch statement example and everything is fine, no error is given and it runs fine but it's not doing what I want it to do. It shows no output at all, any suggestions please?
I don't know what to try because there is no error, it just doesn't work
#include <iostream>
using namespace std;
main ()
{
int student,average,grade,sum;
char A,a,B,b,C,c,D,d,F,f;
student = 1;
average,sum = 0;
cout << "Please enter the grades of student:";
cin >> grade;
switch (grade)
{
case 'A' :
case 'a' :
cout << "excellent";
break;
case 'B' :
case 'b' :
cout << "very good";
break;
case 'C' :
case 'c' :
cout << "good";
break;
case 'D' :
case 'd' :
cout << "Poor";
break;
case 'F' :
case 'f' :
cout << "Fail";
break;
default:
cout << "Please enter the grade from A to D & F";
}
}
I want it to tell me the remarks of the student's grade but it doesn't show anything at all and it will always show the default message no matter what you enter