Segmentation fault


there is some problem in reverse function, can someone help

Hello @akshatkaush,

  1. There are so many silly mistakes in your code.
    a) missed defining the data type of variables
    b) missed semicolon
    c) data type with wrong type

  2. The logic for creating the linked list is wrong.

  3. The logic for reverse is wrong.

Refer to the comments for better understanding:
https://ide.codingblocks.com/s/213561

As there is a need to change the entire code, so I am sharing mine with you:

Suggestion:
Please go through all the videos of linked again.
No need to rush.
Understand the concepts properly including all the basics.
I am saying this for your benefit only.

Hope, this would help.