Linked list print problem


Here is your corrected code. Please check it. Also avoid passing head by reference as you might lose track of your original head in the function.