-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgrade.cpp
More file actions
49 lines (43 loc) · 827 Bytes
/
grade.cpp
File metadata and controls
49 lines (43 loc) · 827 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
#include<stdio.h>
int main()
{
int num;
printf("Enter your number:");
scanf("%d",&num);
if(num<=100)
{
if(num>=80)
{
printf("A+\n");
}
else if(num>=70 && num<=79)
{
printf("A\n");
}
else if(num>=60 && num <=69)
{
printf("A-\n");
}
else if(num>=50&& num<=59)
{
printf("B\n");
}
else if(num>=40&& num<=49)
{
printf("C\n");
}
else if(num<0)
{
printf("Negative number not allowed in grading\n");
}
else
{
printf("Fail\n");
}
}
else
{
printf("Invalid number\n");
}
return 0;
}