-
Notifications
You must be signed in to change notification settings - Fork 0
/
program.c
95 lines (91 loc) · 2.3 KB
/
program.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
#include<stdio.h>
#include<conio.h>
int main()
{
char a,b,c,d,e,f,name[20],state[20];
int i,j=1,age,x,p;
float count=0.00;
printf("\n\n\t\t COVID 19 INFECTION RATE TEST DETECTOR \n\n");
printf("\t\tPLEASE ENTER YOUR BASIC INFORMATION \n");
printf("\tNAME:- ");
gets(name);
printf("\tAGE:- ");
scanf("%d", &age);
if (age>=13)
{
count+=1;
}
printf("\tSTATE:- ");
scanf("%s",state);
printf("\t\t\t\t PLEASE ANSWER THE FOLLOWING QUESTION CORRECTLY\n");
printf("\n\n\tDo you have any travel history across INDIA between jan to mar?(y/n)\nAns:- ");
fflush(stdin);
scanf("%c",&a);
if(a=='y' || a=='Y')
{
count+=1;
}
printf("\n\n\t Do you came in contact with any covid infected parson?(y/n)\nAns:- ");
fflush(stdin);
scanf("%c", &b);
if(b=='y' || b=='Y')
{
count+=1;
}
printf("\n\n\t Is there any covid patient in the range of 1 km?(y/n)\nAns:- ");
fflush(stdin);
scanf("%c", &c);
if(c=='y' || c=='Y')
{
count+=1;
}
printf("\n\n\tAre you suffering of any kind of diseases like CANCER,DIABETES or LUNGS DISEASES?(y/n)\nAns:- ");
fflush(stdin);
scanf("%c", &d);
if(d=='y' || d=='Y')
{
count+=1;
}
printf("\n\n\tPlease let us know your body temperature(in C)\n Ans:-");
scanf("%d",&x);
if (x>=38)
{
count+=1;
}
printf("\n\n\t If you are suffering from any one write y\n\t1) Dry cough \n\t2) Shortness of breath \n\t3) Headaches \n\t4) Aches and Pains \n\t5) Sore throat \n\t6) fatigue \n\t7) Diarrhea \nAns:- ");
fflush(stdin);
scanf("%c",&e);
if(e=='y' || e=='Y')
{
count+=1;
}
printf("\n\n\tAre you suffering from bp or suger problem?(y/n)\n Ans:- ");
fflush(stdin);
scanf("%c",&f);
if (f=='y'|| f=='Y')
{
count+=1;
}
printf("\n\n\t\t RESULT \n\n");
printf("NAME :- ");
puts(name);
printf("AGE:- %d",age);
printf("\nSTATE:- ");
puts(state);
count=count*12.5;
printf("\n\n\t YOUR RATE OF BEING INFECTED IS %0.2f percent",count);
if (count<=30)
{
printf("\n\n\t\t\t CONGRATS! YOU ARE IN GREEN ZONE \n ");
}
else if (count>30 && count<60)
{
printf("\n\n\n\t HEY! YOU ARE IN ORANGE ZONE \n");
}
else
{
printf("\n\n\t\t\t ALERT! YOU ARE IN RED ZONE \n");
}
printf("\n\n\t\t\t STAY HOME STAY SAFE \n");
return 0;
}