#include <stdio.h>
#include<stdlib.h>
struct Node{
    int data;
    struct Node* next;
};
struct Node* createNode(int a){
    struct Node* n=(struct Node *)malloc(sizeof(struct Node));
    n->data=a;
    n->next=NULL;
    return n;
}
void insetAtEnd(struct Node** head int a){
    struct Node*new Node=createNode(a);
    if(*head==NULL){
        *head=newNode;
        return;
    }
    struct Node*temp=*head;
    while(temp->next!=NULL){
    temp=temp->next;
    }
    temp->next=newNode;
}    
void insertAtk(struct Node** head,int a, int k){
    struct Node* n=createNode(a);
    struct Node* temp=*head;
    int i=1;
    while(temp->next!=NULL && i<k-1){
        temp=temp->next;
        i=i+1;
    }
    struct Node* b=temp->next;
    temp->next=n;
    n->next=b;
}
int main(){
    struct Node*head=NULL;
    insert AtEnd(&head,10);
    insert AtEnd(&head,20);
    insert AtEnd(&head,30);
    insert AtEnd(&head,40);
    insert AtEnd(&head,50);
    display(head);
    return 0;
}