#include struct node { int data; node *next; }; node *first; void addnode(int i) { node *n; n=new node; n->data=i; if (first->next==NULL) n->next=NULL; else n->next=first->next; first->next=n; } void main() { first=new node; first->data=0; first->next=NULL; addnode(5); addnode(9); addnode(4); addnode(7); addnode(3); node *p; for (p=first->next;p!=NULL;p=p->next) { printf("data=%d\n",p->data); } }