-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGradingSystem.c
More file actions
50 lines (45 loc) · 946 Bytes
/
GradingSystem.c
File metadata and controls
50 lines (45 loc) · 946 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*This is a Program to check the grade of the students based on marks -
If marks <50 then Grade is F
if marks >=50 <60 then Grade is D
if marks >=60 <70 then Grade is C
if marks >=70 <80 then Grade is B
if marks >=80 <90 then Grade is A
if marks >=90 <=100 then Grade is A+
If marks are not in the above range then print “Invalid”
*/
#include<stdio.h>
int main()
{
int marks;
printf("Enter your marks ");
scanf("%d",&marks);
if(marks<0 || marks>100)
{
printf("Invalid");
}
else if(marks<50)
{
printf("Grade F");
}
else if(marks>=50 && marks<60)
{
printf("Grade D");
}
else if(marks>=60 && marks<70)
{
printf("Grade C");
}
else if(marks>=70 && marks<80)
{
printf("Grade B");
}
else if(marks>=80 && marks<90)
{
printf("Grade A");
}
else
{
printf("Grade A+");
}
return 0;
}