-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path10.0 (C) Student grade system.c
119 lines (102 loc) · 2.69 KB
/
10.0 (C) Student grade system.c
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/// Student grade system
/* Student's mark --- Grade
80-100 A+
70-89 A
60-69 A-
50-59 B
40-49 C
33-39 D
0-32 F
*/
/* ----------------------- Program code: 01 ------------------------*/
#include<stdio.h>
int main()
{
int num;
printf("Enter the exam mark: ");
scanf("%d", &num);
if(80<=num && num<=100)
{
printf("\n\tThe Student's exam mark: %d and grade: 'A+' \n", num);
}
else if(70<=num && num<80)
{
printf("\n\tThe Student's exam mark: %d and grade: 'A' \n", num);
}
else if(60<=num && num<70)
{
printf("\n\tThe Student's exam mark: %d and grade: 'A-' \n", num);
}
else if(50<=num && num<60)
{
printf("\n\tThe Student's exam mark: %d and grade: 'B' \n", num);
}
else if(40<=num && num<50)
{
printf("\n\tThe Student's exam mark: %d and grade: 'C' \n", num);
}
else if(33<=num && num<40)
{
printf("\n\tThe Student's exam mark: %d and grade: 'D' \n", num);
}
else if(0<=num && num<32)
{
printf("\n\tThe Student's exam mark: %d and grade: 'F' \n", num);
}
else{
printf("\n\tThis mark doesn't accepted!");
}
return 0;
}
/* ===== Output / Result:
Input:
Enter the exam mark: 65
Output:
The Student's exam mark: 65 and grade: 'A-'
*/
/* ----------------------- Program code: 02 ------------------------/
#include<stdio.h>
int main()
{
int num;
printf("Enter the exam mark: ");
scanf("%d", &num);
if (80<=num && num<=100)
{
printf("\n\tThe Student's exam mark: %d and grade: 'A+' \n", num);
}
else if (num>=70)
{
printf("\n\tThe Student's exam mark: %d and grade: 'A' \n", num);
}
else if (num>=60)
{
printf("\n\tThe Student's exam mark: %d and grade: 'A-' \n", num);
}
else if(num>=50)
{
printf("\n\tThe Student's exam mark: %d and grade: 'B' \n", num);
}
else if(num>=40)
{
printf("\n\tThe Student's exam mark: %d and grade: 'C' \n", num);
}
else if(num>=33)
{
printf("\n\tThe Student's exam mark: %d and grade: 'D' \n", num);
}
else if(0<=num && num<32)
{
printf("\n\tThe Student's exam mark: %d and grade: 'F' \n", num);
}
else{
printf("\n\tThis mark doesn't accepted!");
}
return 0;
}
/* ===== Output / Result:
Input:
Enter the exam mark: 65
Output:
The Student's exam mark: 65 and grade: 'A-'
*/