This is the simplest and easiest program to understand how to reverse the linked list. I have used same function to create a linkedlist and to reverse the linkedlist. Comments and suggestions are welcome.

input 1 -> 2 -> 3 -> 4 -> 5
output 5 -> 4 -> 3 -> 2 -> 1

#include 

using namespace std;

struct Node
{
	Node *next;
	int data;
};

void add(Node **head, int data);
void display(Node *head);

void add(Node **head, int data)
{
	Node  *temp = new Node();
	temp -> data = data;
	temp -> next = *head;
	*head = temp;
}

void display(Node *head)
{
	Node *cur = head;
	while (cur)
	{
		cout << cur -> data;
		if( cur -> next != NULL)
			cout << ", ";
		cur = cur-> next;
	}
	cout << endl;
}


int main ()
{
	Node *head = new Node();

	/* node is adding to the link list*/
	head -> data = 10;
	head -> next = NULL;
        add( &head, 9);
	add( &head, 8);
	add( &head, 7);
	add( &head, 6);
	add( &head, 5);
	add( &head, 4);
	add( &head, 3);
	add( &head, 2);
	add( &head, 1);
	add( &head, 0);
/* end of adding nodes to link list*/

	cout << " list before sorting" << endl;
	display(head);

	Node *cur = head;
	Node *reverseList = new Node();
	reverseList -> data = cur -> data;
	reverseList -> next = NULL;
	cur = cur -> next;

	/* code to call same add function to reverse the Link list*/
	while(cur)
	{
		add(&reverseList, cur -> data);
		cur = cur -> next;	
	}
	 
	/* end of code reverse the link list*/
	cout << " list after sorting" << endl;
	display(reverseList);

	return 0;
}