Test ettim hocam bu kod işine yarar umarım.

int asalmi(int sayi)
{
int i=2,sq;
if(sayi == 2)
return 0;
sq=(int)sqrt(sayi);
if(sayi % 2 == 0)
return 2;
for(i = 3; i <= sq; i+=2)
if((sayi % i) == 0)
return i;
return 0;
}
//-----------------------------------------------------------
int bolen,bolunen,sayi = 231;
bolen = asalmi(sayi);
if(bolen != 0)
{
bolunen = sayi / bolen;
if(asalmi(bolen) == 0 && asalmi(bolunen) == 0)
printf("yari asal");
else
printf("yari asal degil");
}
else
printf("asal");