Write a
program to find grading scheme using (switch statement):
#include<stdio.h>
#include<conio.h>
int main()
{
int marks;
clrscr();
printf("Enter
the marks of the students");
scanf("%d",&marks);
marks=marks/10;
switch(marks)
{
case 10:
case 9:
case 8:
printf("The grade is Honors");
break;
case 7:
case 6:
printf("The grade is 1st
Division");
break;
case 5:
printf("The grade is 2nd
Division");
break;
case 4:
printf("The grade is 3rd
Division");
break;
default:
printf("Student is failed");
}
getch();
return(0);
}
OUTPUT:
Enter the marks
of the student
72
The grade is 1st
Division
Helpful for me thanks
ReplyDeleteGood thank thank bro
ReplyDelete6. Create an array that can hold 10 student grade out of 100 mark. Accept the grade from the user to fill the array and display the data. Also count and display how many students score <=50 and how many score >50. (use for loop for array manipulation and switch to count the number of student who score <=50 and >50)
ReplyDelete#include
ReplyDeleteusing namespace std;
int main()
{
int grade[10];
for(int i= 1 ; i<= 10 ; i++ ){
cout << "Enter the number of Grade " << i << " :" << endl;
cin >> grade[i];
}
int below = 0 ,above = 0;
for(int i = 1 ; i <= 10 ; i++){
if (grade[i] <= 50){
below++;
}
else
{
above++;
}
}
cout << " how many students score <=50 : "<50 : " << above << else
How you assign case to percentage
ReplyDeleteno no its so bad not good bruh..❗🙂
ReplyDeleteMarks 0-20,20-40,40-60,60-80,80-100
ReplyDeletegrade E ,D ,C ,B ,A
Using switch statement to display the grade as per following criteria
If the mark is divided by 10.we will get 7.2.It's not exact 7.so why it will work.
ReplyDeleteIf the mark is divided by 10.we will get 7.2.It's not exact 7.so why it will work.
ReplyDelete