#include <stdio.h>
main(){
int bil,i;
int x;
int hasil,parameter=0;
printf ("input bilangan: ");
scanf ("%d",&bil);
for (i=0 ; i<bil ; i++){
x=bil-i;
hasil=bil%x;
if (hasil==0){
parameter=parameter+1;
}
}
if (parameter==2){
printf ("Yang anda input adalah bilangan PRIMA \n");
}
else
printf ("bukan bilangan prima \n");
//system ("pause");
return 0;
}
Wednesday, October 12, 2011
6:51 AM
Cari bilangan Priman di CodeBlocks
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment