#include<iostream.h>
#include<conio.h>
struct linklist
{
 int data;
 struct linklist *next;
};
main()
{
 struct linklist *pnode1,*pnode2,*pnode3;
pnode1=(struct linklist*)malloc(sizeof(struct linklist));
pnode1->data=10;
pnode1->next=NULL;
pnode2=(struct linklist*)malloc(sizeof(struct linklist));
pnode2->data=20;
pnode2->next=NULL;
pnode1->next=pnode2;
pnode3=(struct linklist*)malloc(sizeof(struct linklist));
pnode3->data=30;
pnode3->next=NULL;
pnode2->next=pnode3;
if(pnode1->data>pnode2->data&&pnode1->data>pnode3->data)
{
 cout<<"pnode is greater"<<endl;
}
else if(pnode2->data>pnode1->data&&pnode2->data>pnode3->data)
{
 cout<<"pnode2 is greater"<<endl;
}
else
{
    cout<<"pnode3 is greater"<<endl; 
}
getch();
}