Skip to content

Instantly share code, notes, and snippets.

@jskeet
Created November 2, 2018 10:26
Show Gist options
  • Save jskeet/f386552fc3c9fa5c5cdfa27b90ed4677 to your computer and use it in GitHub Desktop.
Save jskeet/f386552fc3c9fa5c5cdfa27b90ed4677 to your computer and use it in GitHub Desktop.
public class Test {
public static void main(String[] args) {
int n = 1; // Less than 2
int x = 1;
int y = 2;
while (y < n) {
// This is never reached
System.out.println("In while loop");
if (n % y == 0) {
n = n / y;
x++;
}
else y++;
}
System.out.println(x + " " + n);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment