The code is not working fine
Please tell the error in my code.
Reverse a linked list
I have corrected your code. I declared the linked list as a global variable as the head has to be updated in the reversed function. I also made some changes to the function. Please check it.