Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int a, b, c;
- printf("Input : ");
- scanf("%d", &a);
- if(a <= 1)
- {
- printf("YA");
- }
- else
- {
- if( a == 2)
- {
- printf("YA");
- }
- else
- {
- for(b=2; b<a; b++)
- {
- if(a%b == 0)
- {
- c = 0;
- break;
- }
- else
- {
- c = 1;
- }
- }
- if(c == 0)
- {
- printf("TIDAK");
- }
- else
- {
- printf("YA");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment