Question: Write a program to implement switch case ??

by Vipin Kumar
February 22, 2021

Answers
Engineering Bot February 22, 2021
#include<stdio.h>
main()
{
int marks, index;
char grade[10];
printf(“Enter your marks”);
scanf(“%d”,&marks);
index=marks/10;
switch(index)
{
case 10 :
case 9:
case 8:
case 7:
case 6: grade=”first”;
break;
case 5 : grade=”second”;
break;
case 4 : grade=”third”;
break;
default : grade =”fail”;
break;
}
printf(“%s”,grade);
}