/* * C Program to accept a grade and declare the equivalent description * if code is S, then print SUPER * if code is A, then print VERY GOOD * if code is B, then print FAIR * if code is Y, then print ABSENT * if code is F, then print FAILS */ #include #include #include void main() { char remark[15]; char grade; printf("Enter the grade \n"); scanf("%c", &grade); /* lower case letter to upper case */ grade = toupper(grade); switch(grade) { case 'S': strcpy(remark, " SUPER"); break; case 'A': strcpy(remark, " VERY GOOD"); break; case 'B': strcpy(remark, " FAIR"); break; case 'Y': strcpy(remark, " ABSENT"); break; case 'F': strcpy(remark, " FAILS"); break; default : strcpy(remark, "ERROR IN GRADE \n"); break; } printf("RESULT : %s\n", remark); }