I have written the code but its giving error.
How to make a doubly linked list?
Your code is not working because there is an error in the while loop inside the MakelinkedList() function.
The statement temp=temp->next is not getting executed. But, the loop continues iterating infinitely.
Hint: there must be some problem with the syntax.
Resolve it and your code will run perfectly.
Hope, this would help.
If you still have doubts, feel free to ask.