I need to square the predefined array, but the problem is the iteration depends on what number the user enter is. I'm only new to java and do not know how it works.

```java
int[] array = {1, 2, 3, 4, 5}; // Predefined array.

Scanner in = new Scanner(System.in);

int num = in.nextInt(); // Number of loop.
int sq = 0, sq2 = 0, sq3 = 0, sq4 = 0, sq5 = 0;

for (int i = 0; i < num; i++) {
    sq = array[i] * array[i];
    sq2 = array[i] * array[i];
    sq3 = array[i] * array[i];
    sq4 = array[i] * array[i];
    sq5 = array[i] * array[i];
}

for (int i = 0; i < num; i++) {
    System.out.println(sq);
    System.out.println(sq2);
    System.out.println(sq3);
    System.out.println(sq4);
    System.out.println(sq5);
}

```

***Input:***

```
1 //iteration

```

***Output:***

```
1
1
1
1
1

```

***Expected output:***

```
001
004
009
016
025

```