Also it's just recommended to use specifically bool for while loops. It's poor coding generally to not use them but nonetheless you can still use ints and such
For example, using getline in a while loop initializer could be used to continue tell the end of a file without getting a legitimate bool involved, it's an extra step in that case.
not while the code is running no. Also decreasing i after the loop has passed is not going to make the loop happen again as that part of the code has past as the bit that checks i has already said "no i isnt less than 5 go to the next part"
that's what the code in the post does. It increments i at the end of every loop until i hits 5.
this is like "intro to anything coding page 2 day 1" shit if you took a class over this kind of thing you failed it
For example, using getline in a while loop initializer could be used to continue tell the end of a file without getting a legitimate bool involved, it's an extra step in that case.
this is like "intro to anything coding page 2 day 1" shit if you took a class over this kind of thing you failed it
while (true) {
for (i++; i <= 5; i++) {
print(i);
}
for (i--; i >= 0; i--) {
print(i);
}
}