Advertisement
mario_mos

ddd

Jul 24th, 2023
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <limits.h>
  3.  
  4. int main()
  5. {
  6. int x;
  7. printf("Enter an integer: ");
  8. scanf("%d", &x);
  9. printf("You entered: %d \n", x);
  10.  
  11.  
  12. for(int i=2; i <= x/i; i = i + 1)
  13. {
  14. int factor = x/i;
  15. if (factor*i == x)
  16. {
  17. printf("false\n" );
  18. //break;
  19. }
  20. else {
  21. printf("true\n ");
  22. }
  23. }
  24.  
  25.  
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement