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
1 . Write a program that reads characters from the keyboard until a period is received.
Have the program count the number of spaces. Report the total at the end of the pro-
gram.
2 . Show the general form of the if - else - if ladder.
3 . Given
Search WWH ::




Custom Search