Question 2-2

Say we've defined the following method.

public static int f(int n) {
    IO.println(n);
    return n / 2;
}
Also, say our program executes the line
IO.println(1 + f(1 + f(12)));
What is printed in executing this line?

Solution

12
7
4

Back to 8:00 Quiz 2