Write program code that takes 'n' numbers as input and adds them to the linked list. Make sure the nodes of the linked list are sorted based on the numbers given as input.