-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
51 lines (43 loc) · 901 Bytes
/
main.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
#include"header.h"
int main()
{
employee_database *hptr = 0;
data_component(&hptr);
char employee_id[10];
int choice, cnt=0;
while(1)
{
printf("\n-------------------------------------------------------\n");
printf("1.Add, 2.View, 3.Modify, 4.Delete, 5.Exit\n ");
printf("Please enter your choice\n");
scanf("%d",&choice);
switch(choice)
{
case 1: add_data(&hptr);
break;
case 2: printf("Enter the Employee ID :");
scanf("%s",employee_id);
view_data(employee_id,hptr);
break;
case 3: modify_data(&hptr);
break;
case 4: delete_data(&hptr);
break;
case 5: return 0;
default:cnt++;
if(cnt==1)
{
printf("You have 2 attempts:\n");
continue;
}
else if(cnt==2)
{
printf("You have 1 attempts:\n");
continue;
}
else
printf("You dont have any more attempts.\n");
return 0;
}
}
}