Thanks for the reply .I have one more doubt how this statement q=q->link is differ from
q->link=tmp
So let say I have 3 numbers
1
2
3
first for 1 it will go to
Code:
if(start==NULL)
start=tmp;// This means it will store the value of tmp to start i.e. 1
then for 2 it will go to else part
Code:
else
{
q=start; //Here it will store value start to q
while(q->link!=NULL) //Since q is not not null it not go into q=q->link
{
q=q->link;
}
q->link=tmp; //Here I came to know we are storing value 2 ,what this statement means
}