/*Write a C Program to read percentage of marks and to display appropriate grade (using switch case) */ #include < stdio.h> #include < stdlib.h> void main() { long int m1, m2, m3, m4, m5, m6; long int percent; printf("Enter the marks for 6 subjects\n"); scanf("%ld %ld %ld %ld %ld %ld", &m1, &m2, &m3, &m4, &m5, &m6); percent = ((m1 + m2 + m3 + m4 + m5 + m6) * 100 / 600); printf("Percentage : %ld\n", percent); if(percent >90) printf("S grade\n"); else if(percent >70) printf("A grade\n"); else if(percent >50) printf("B grade\n"); else if(percent >40) printf("C grade\n"); else if(percent >30) printf("D grade\n"); default: printf("Invalid input"); exit(0); } }