#include <iostream>
using namespace std;
int main(){
cout<<"Input marks: ";
int marks; cin>>marks;
char grade;
switch(marks/10){
case 10:;
case 9:;
case 8: grade = 'A'; break;
case 7: grade = 'B'; break;
case 6: grade = 'C'; break;
case 5: grade = 'D'; break;
default: grade = 'F';
}
cout<<"Grade: "<<grade;
}
Comments
Leave a comment