Linked list reverse

https://ide.codingblocks.com/s/58233
why is it not printing 5 as first node after reversing

Hi Simran, just make the following change in the while loop at line number 36:
Instead of while(cur->next!=NULL){, make it while(cur!=NULL){

1 Like