Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <limits.h>
- int main()
- {
- int x;
- printf("Enter an integer: ");
- scanf("%d", &x);
- printf("You entered: %d \n", x);
- for(int i=2; i <= x/i; i = i + 1)
- {
- int factor = x/i;
- if (factor*i == x)
- {
- printf("false\n" );
- //break;
- }
- else {
- printf("true\n ");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement