Linked Lists - Insert Function Modification : The program should show the element to be inserted at a position greater than the current size of the linked list at the end.

I have tried the following piece of code : (Changed == with >= )

    if(pos >= 1)
    {
    newNode->next = start;
    start = newNode;
    }





void insert(){
    int i,pos;

    newNode = (node*)malloc(sizeof(node));
    printf("\nEnter the data to insert : ");
    scanf("%d",&newNode->data);
    newNode->next = NULL;
    printf("\nEnter the position : ");
    scanf("%d",&pos);

    if(pos == 1){
        newNode->next = start;
        start = newNode;
    }

    else{
        for(temp = start,i = 1;temp != NULL;temp = temp->next,i++){
            if(i == (pos - 1)){
                newNode->next = temp->next;
                temp->next = newNode;
                break;
            }
        }
    }
}



I expect the output to show the node inserted at a position greater than the size of current linked list at the ending. The current code takes the input, however it doesn't display it at end.