-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgithub.c
34 lines (32 loc) · 812 Bytes
/
github.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
#include"C:\DSA_Lab\Lab_03\practice\algorithm.c"
x* create_linked_list( int n)
{
x *head = NULL,*t = NULL,*c = NULL;
// head->data = 45;
// int x;
loop(i,n){
if (head == NULL)
{
head = (x*) malloc(sizeof(x));
// head ->data = i + (i+ 1)*(i+2) - (i+3)*(i+4)/(100-i);
in(head->data);
// cin<<(head->data);
head ->next = NULL;
c = head;
}
else{
t = al(1);
scanf("%d",&t->data);
// t ->data = i + (i+ 1)*(i+2) - (i+3)*(i+4)/(100-i);
t ->next = NULL;
c ->next = t;
c = t;
}
}
return head;
}
int main()
{
x* head = create_linked_list(10);
print_list(head);
}