-
Notifications
You must be signed in to change notification settings - Fork 0
/
Find roll no.c
43 lines (24 loc) · 873 Bytes
/
Find roll no.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
// Function to search the students list
// by the given first name
void find_fn(){
char a[50];
printf(" Enter the first name of the student\n");
a = "Rutik";
int c = 0;
// Iterating througth the student list
for (int j = 0; j <= i; j++){
// compare the first names
if (!strcmp(st[j].fname,a)){
printf("The Student details are\n");
printf("The First name is %s\n", st[j].fname);
printf("The last name is %s\n", st[j].lname);
printf("The roll number is %d\n",st[j].roll);
printf(" The CGPA is %f\n", st[j].cgpa);
printf("Enter the course ID of each course\n");
for (int k = 0; k < 5; k++){
printf("The course ID are %d\n", st[j].cid[k]);
}
c= 1;
}
}
}