I stuck on the exercise at the page of 18 at unit "Arrays and Loops".
I feel the exercise directs me to use while loop but I did not find a way to do that.
Thanks for the help by now.
I stuck on the exercise at the page of 18 at unit "Arrays and Loops".
I feel the exercise directs me to use while loop but I did not find a way to do that.
Thanks for the help by now.
Can you show a link to the exercise?
Show the book and tell exactly what you don't understand.
While loop have 2 patterns:
while someCondition {
// Do something
}
or
repeat {
// do something
} while otherCondition
With the first one, someCondition is tested before executing ; so there may be no iteration at all
With the second otherCondition is tested after an iteration is executed: it is thus executed at least once.