Why m i getting error?

https://ide.geeksforgeeks.org/ccOnM0NaKd

Hey, There were couple of problems with your code.

  1. reversenode function was declared as Void type but it was returning a pointer so it was showing an error.
  2. reversenode function accepts 2 parameters (first a pointer to the list and second an integer) but only one parameter was passed.
    Here is an updated version of the code with all the errors resolved: https://ide.codingblocks.com/s/171012

As for the correctness of the solution you need to actually append the elements at the tail or insert the elements in reverse order and receive the output of reversenode in head in the main.
Here is code with corrected logical errors: https://ide.codingblocks.com/s/171051
Let me know if you face any other problem.