void fromlast(int
n)
{
node *ptr=start,*loc=start;
int i=0;
while(ptr!=NULL)
{
if(i<n)
i++;
else
loc=loc->next;
ptr=ptr->next;
}
cout<<"\nelement is
"<<loc->data;
}
No comments:
Post a Comment