-
Notifications
You must be signed in to change notification settings - Fork 0
/
graceMarks.c
43 lines (38 loc) · 896 Bytes
/
graceMarks.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
/*Program to calculate grace marks*/
/*AUTHOR:rapteon; DATE:2019-01-12*/
#include<stdio.h>
int main()
{
int subject_class, failed, grace; /*subject_class = Class obtained byb student.
failed = number of subjects in which student failed.*/
printf("Enter the class of result of the student...\n");
printf("1 First\n");
printf("2 Second\n");
printf("3 Third\n");
printf("Select 1/2/3 ?");
scanf("%d", &subject_class);
printf("Enter the number of subjects in which student failed...\n");
scanf("%d", &failed);
if(subject_class == 1)
{
if(failed>3)
grace = 0;
if(failed<=3)
grace = 5;
}
else if(subject_class == 2)
{
if(failed>2)
grace = 0;
if(failed<=2)
grace = 4;
}
else if(subject_class == 3)
{
if(failed>1)
grace = 0;
if(failed == 1)
grace = 5;
}
printf("The grace marks obtained by the student is %d per subject.\n", grace);
}