Linked List
Linked List
h>
#include<stdio.h>
struct Node{
int data;
struct Node* next;
};
struct Node* head;
void Insert(int r);
{
Node* temp = (Node*)malloc(sizeof(struct Node));
temp->.data = r;
temp->next = NULL;
if(head != NULL) temp->next =head;
head = temp;
}
void Print()
{
struct Node* temp = head;
printf("List is: ");
while(temp !=NULL)
{
printf("%d" ,temp->data);
temp= temp->next;
}
printf("\n");
}
int main() {
head = NULL;
int n,r,a,i;
printf("Roll Number:\n");
scanf("%d",&n);
for(i=0;i<r;i++){
printf("Enter the roll number \r");
scanf("%d",&r);
Insert(r);
Print();
printf("Enter the Age \a");
scanf("%d",&a);
Insert(a);
Print();
printf("Enter the CET Score \n");
scanf("%d",&n);
Insert(n);
Print();
}
}