-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstudenteligibility.c
64 lines (49 loc) · 1.01 KB
/
studenteligibility.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
#include <assert.h>
#include <ctype.h>
#include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct student
{
int reg;
int jun;
char name[20];
int july;
int aug;
int sep;
float tot;
float avg;
char eligibilty[5];
};
int main()
{
struct student s;
scanf("%d%s%d%d%d%d",&s.reg,s.name,&s.jun,&s.july,&s.aug,&s.sep);
s.tot = s.jun + s.july + s.aug + s.sep;
s.avg = (s.tot*100)/84;
if(s.tot>84)
{
printf("Invalid data:No.of.present days is greater than working day");
}
else{
if(s.avg>70)
{
strcpy(s.eligibilty,"yes");
}
else
{
strcpy(s.eligibilty,"no");
}
printf("Reg.no:%d",s.reg);
printf("\nName:%s",s.name);
printf("\nTotal.No.of.present days:%0.0f",s.tot);
printf("\nAttendence:%0.2f",s.avg);
printf("\neligibility:%s",s.eligibilty);
}
return 0;
}