CS 1401, Quiz #10

Date: Monday, November 14, 2005
Name (please type legibly, ideally in block letters): ______________________________________________________________________

1. Use the ? construction to assign to the variable sign the value +1 is i is positive and -1 if i is non-positive.





















2. What is printed by the following code fragment? Trace your results, do not just guess.
for (i = 0, j = 2; i < 4 && j > 0; i++, j--)  
  System.out.println(i + " " + j);