4.2.9 Replace For Loop With While Loop