Switch statement of A=" excellent" , B="very good",C="good" ,D="fair",F="fail" Else invalid?
Answers
Answered by
0
Answer:
#include <stdio.h>
int main()
{
char grade;
printf("Enter your grade: ");
scanf("%c",&grade);
switch(grade){
case 'A':
printf("excellent");
break;
case 'B':
printf("very good");
break;
case 'C':
printf("good");
break;
case 'D':
printf("fair");
break;
case 'F':
printf("fail");
break;
default:
printf("invalid");
}
return 0;
}
Similar questions