There's nothing in the output. Only blinking cursor.
#include<stdio.h> #include<stdlib.h> struct node { int rno; struct node *next; }; void main() { int n,i,r; struct node *head; //head=(struct node *)malloc(sizeof(struct node)); head=NULL; //scanf("%d",&n); n=5; for(i=1;i<=n;++i) { r=i; //scanf("%d",&r); if(head==NULL) { head=(struct node *)malloc(sizeof(struct node)); head->rno=r; head->next=NULL; } struct node *tmp; tmp=head; int f=0; while(tmp!=NULL) { if(tmp->rno==r) { f=1; break; } tmp=tmp->next; } if(f=0) { tmp->nex