Create CekBilanganPrima.c

master
Muhammad Daffa 2020-04-10 13:23:44 +07:00 committed by GitHub
parent 46226e6e89
commit c54e63ebc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,22 @@
#include <stdio.h>
#include <math.h>
int main() {
int a,b,i,j,y;
scanf("%d",&b);
for(j=0;j<b;j++) {
scanf("%d",&a);
for(i=2;i<=trunc(sqrt(a));i++) {
if (a%i == 0) {
y = 1;
}
}
if (y || a == 1) {
y = 0;
printf("BUKAN\n");
}
else {
printf("YA\n");
}
}
}