Mark As Completed Discussion

Let's test your knowledge. Fill in the missing part by typing it in.

What line below would give us the proper count?

TEXT/X-JAVA
1class Main {
2    public static int howManySquares(int num) {
3        int count = 0;
4
5        for (int i = 1; i <= num; i++)
6
7            // Is current number 'i' a perfect square?
8            for (int j = 1; j * j <= i; j++)
9                if (j * j == i)
10                    _______________________
11
12        return count;
13    }
14
15    public static void main(String args[]) {
16        this.howManySquares(4);
17    }
18}

Write the missing line below.