Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int[] whatAreProperDivisorsOf(int x) {
- //array to store the values
- int[] temp = new int[x];
- int index = 0;
- for (int i = 1; i < x; i++) {
- if (x % i == 0) {
- temp[index] = i; //-1 as starting at one but index 0
- index++;
- System.out.println("x: " + x + " i: " + i);
- // for (int j = 0; j < temp.length; j++) {
- System.out.println(temp[index]);
- }
- }
- return temp;
- }
Add Comment
Please, Sign In to add comment