top of page
#include<stdio.h>
int asalMi(int);
int main(void){
int (*fonkPtr)(int)=asalMi;
int number;
printf("Enter the number that you want to see if is prime or not : \n");
scanf("%d",&number);
int isPrime=(*fonkPtr)(number);
if(isPrime!=0){
printf("%d is A prime number !!! \n",number);
printf("dondurdugu deger : %d\n",isPrime);
}
else{
printf("%d is NOT A prime number !!!\n",number);
printf("dondurdugu deger : %d\n",isPrime);
}
return 0;
}
int asalMi(int number){
int i;
for(i=2;i<=number/2;i++){
if(number%i==0){
return 0;
break;
}
}
}
bottom of page