Guest User

Untitled

a guest
Jan 17th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1.  public static int[] whatAreProperDivisorsOf(int x) {
  2.         //array to store the values
  3.         int[] temp = new int[x];
  4.         int index = 0;
  5.  
  6.         for (int i = 1; i < x; i++) {
  7.             if (x % i == 0) {
  8.                 temp[index] = i;  //-1 as starting at one but index 0
  9.                 index++;
  10.                 System.out.println("x: " + x + " i: " + i);
  11. //                for (int j = 0; j < temp.length; j++) {
  12.                 System.out.println(temp[index]);
  13.             }
  14.         }
  15.         return temp;
  16.     }
Add Comment
Please, Sign In to add comment