Need explanation of order of data inserted in LL and order of output

in this problem program is gettting data in following order

int main(){
node*head=NULL;
insertathead(head,3);
insertathead(head,2);
insertathead(head,1);
insertathead(head,0);

but output of program is 0-> 1-> 2-> 3->
why this is happen?

you are inserting the node at head not at tail

first you insert 3
then 2 at head so ll will be 2->3
then 1 at head so ll will be 1->2->3
so on …
0->1->2->3

i hope you understand now
if you have any further doubt in this feel free to ask