Linked list related doubt

code is about inputting and printing the linked list but it is not getting compiled.

it will not compile because there is a missing } for constructor of node and for printing you have to do
node *temp=head; instead of node *temp=NULL;