#include using namespace std; struct node { int data; struct node *next; }; int main() { struct node *prev,*head,*p; head=NULL; int n; scanf("%d",&n); for(int i=0;idata); p->next=NULL; if(head==NULL){ head=p; } else { prev->next=p; } prev=p; } int x; printf("Enter position: "); scanf("%d",&x); struct node *ptr=head; int i; while(ptr!=NULL) { ++i; if(i==x) { prev->next=ptr->next; free(ptr); break; } prev=ptr; ptr=ptr->next; } ptr=head; while(ptr!=NULL) { printf("%d ", ptr->data); ptr=ptr->next; } return 0; }