posted 22 years ago
Hi sonir,
The answer is going to be 4, 4. The reason for this is that the for loop executes 4 times. The counter (i) is set to 0. The loop executes while i <=3 (less than or equal). So this is how the counter gets incremented:
loop 1: 0<=3 k =1, m=1
loop 2: 1<=3 k =2, m=2
loop 3: 2<=3 k =3, m=3
loop 4: 3<=3 k =4, m=4
The if statement does nothing in this class. It's just there to try and throw you off.
Hope that helps,
/rick