Code:
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>


typedef struct data
{
int songuyen;
};


typedef struct node
{
data infor;
node *next;
};


node *F;
void makenull(){F=NULL;}
//ham nhap
void nhap()
{
data x;
fflush(stdin);
printf("\n Nhap so:");
scanf("%d",&x.songuyen);
node *p;
p=new node;
p->infor=x;
p->next=NULL;
node *q;
if(F==NULL) F=p;
else
{
q=F;
while(q->next !=NULL) q=q->next;
q->next=p;
}
}

//ham hien thi so nguyen vua nhap
void hienthi()
{
node *p;
p=F;
while(p !=NULL)
{
printf("%4d",p->infor.songuyen);
p=p->next;
}
}

//hàm kiem tra so nguyen to
int kiemTraNguyenTo(int so)
{
//so nguyen to
int ngto = 1;
if(so >= 2)
{
for(int i=2; i <= so/2; i++)
{
if(so%i == 0)
{
ngto = 0;
break;
}
}
}
else
{
ngto = 0;
}
return ngto;
}

//Hàm in ra so nguyen to trong node
void inRaNguyenToTrongNode()
{
node *p;
p = F;
while(p!=NULL)
{
if(kiemTraNguyenTo(p->infor.songuyen) == 1) printf("%i ", p->infor.songuyen);
p=p->next;
}
}


main()
{
system("cls");
int x;
char chon;
do
{
nhap();
printf("Ban co muon nhap tiep khong??(y/n):");
fflush(stdin);
chon=getchar();
} while(chon=='y');

printf("So da nhap la:");
hienthi();

printf("\nSo nguyen to trong node: ");
inRaNguyenToTrongNode();
getch();
}