-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpush pop.c
More file actions
118 lines (98 loc) · 2.87 KB
/
Copy pathpush pop.c
File metadata and controls
118 lines (98 loc) · 2.87 KB
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
int update()
{
system("cls");
display();
char name[100],id[20],dept[20],semester[20],section[20];
long long int phone;
int batch;
float cgpa;
printf("\nWrite the ID that want to edit: ");
scanf("%s",&id);
struct node *link=Head;
while(link != NULL)
{
if(strcmp(link->ID,id)==0)
{
break;
}
else
{
link = link->ptr;
}
}
if(link == NULL)
{
printf("\nYour search ID didn't match ! ! ! Press any key to continue\n");
getch();
displayTitle();
}
else
{
printf("\n\n");
printf("1. Change Name\n");
printf("2. Change ID\n");
printf("3. Change Department\n");
printf("4. Change Batch\n");
printf("5. Change Semester\n");
printf("6. Change Section\n");
printf("7. Change CGPA\n");
printf("8. Change Phone Number\n");
printf("\nEnter your choice: ");
int choice;
scanf("%d",&choice);
switch(choice)
{
case 1:
printf("\nWrite The Update Name : ");
scanf("%c",&ch);
gets(name);
strcpy(link->Name,name);
break;
case 2:
printf("\nWrite The Update ID : ");
scanf("%c",&ch);
gets(id);
strcpy(link->ID,id);
break;
case 3:
printf("\nWrite The Update Department : ");
scanf("%c",&ch);
gets(dept);
strcpy(link->Deparment,dept);
break;
case 4:
printf("\nWrite the update Batch : ");
scanf("%d",&batch);
link->Batch = batch;
break;
case 5:
printf("\nWrite the update Semester : ");
scanf("%c",&ch);
gets(semester);
strcpy(link->Semester,semester);
break;
case 6:
printf("\nWrite the update Section : ");
scanf("%c",&ch);
gets(section);
strcpy(link->Section,section);
break;
case 7:
printf("\nWrite the update CGPA : ");
scanf("%f",&cgpa);
link->CGPA = cgpa;
break;
case 8:
printf("\nWrite the update Phone Number : ");
scanf("%lld",&phone);
strcpy(link->Phone,phone);
break;
default:
system("cls");
printf("You have choosen wrong option !!! press any key to continue ");
getch();
displayTitle();
break;
}
}
}