1.

node *reverse(node *list)

{

node *prev , *current, *next;

current=list;

prev=NULL;

while(current!=NULL)

{

next= current->next;

current->next=prev;

prev=current;

current=next;

}

list=prev;

return list;

}

2. void swap(int *a, int *b)

{

int temp;

temp=*a;

*a=*b;

*b=temp;

}

node *reverse(node *list)

{

node *prev , *current, *next;

current=list;

prev=NULL;

while(current!=NULL)

{

next= current->next;

current->next=prev;

prev=current;

current=next;

}

list=prev;

return list;

}

2. void swap(int *a, int *b)

{

int temp;

temp=*a;

*a=*b;

*b=temp;

}

struct node {

int x;

struct node * next;

};

typedef struct node node;

node * reverse (node * list);

2.

int c,d;

int *a = &c, *b = &d;

Write a C function to swap the values of a and b.