Java Reference
In-Depth Information
In the program, the outer loop runs
i
from 2 through 100. The inner loop successively tests
all numbers from 2 up to
i
, printing those that evenly divide
i
. Extra challenge: The preced-
ing program can be made more efficient. Can you see how? (Hint: The number of iterations
in the inner loop can be reduced.)
Chapter 3 Self Test
Have the program count the number of spaces. Report the total at the end of the pro-
gram.