+ 1
Which loop is known as bottom tested loop and top tested loop ?
Can anyone explain?
3 Réponses
+ 3
ChrA means while is top tested? & do....while is bottom tested?
+ 2
Hi.
There are loops such as
do {
// Your code
} while(_condition_);
where the test for another run of the code in curly braces is done at the end. Usually these loops are ran at least once. The other type would be
while (_condition_) {you
// Your code
}
where the condition is evaluated at the beginning. If the condition does not hold (is tested false) from the beginning the code is not executed at all.
Hope that helps. C
+ 1
https://code.sololearn.com/c28B0JNtdQdK/?ref=app
See the output of this code. Choice for i to be ten was just random