control structure

6 moment(s) that assert this concept — showing 1–6 of 6

single sourceRests on a single channel — treat as a lead, verify independently
↣ how this spread over time →
provenance — click a node to open its encoding unit
[1] [email protected][2] [email protected][3] [email protected][4] [email protected][5] [email protected][6] [email protected]
showing 6 of 6 moments
[email protected] · archiveorg · en
1A while loop is similar to an if statement, but it executes its body multiple times instead of just once.
“It's a little bit like an if statement, except that the body of the statement isn't executed just once.”
spoken · 49s · 2017-03-16
[email protected] · archiveorg · en
2A while loop is a control structure that executes its body repeatedly as long as a given condition remains true.
“So here's a while loop.”
spoken · 141s · 2017-03-16
[email protected] · archiveorg · en
3The body of a while loop is the block of code that is executed repeatedly as long as the loop condition is true.
“Everything inside the while clause, starting from the first brace and ending with the closing brace here, all of that is called the loop body.”
spoken · 263s · 2017-03-16
[email protected] · archiveorg · en
4The loop condition in a while loop must be checked before each iteration of the loop body.
“When it hits the while statement, it checks whether divisor is less than n, just like an if statement.”
spoken · 308s · 2017-03-16
[email protected] · archiveorg · en
5A while loop checks its condition before executing its body, and if the condition is false at the start, the body will not execute at all.
“And if divisor is less than n, it won't execute the loop body even once.”
spoken · 314s · 2017-03-16
[email protected] · archiveorg · en
6In Java, a while loop will not execute its body if the loop condition is false at the start.
“And if divisor is less than n, it won't execute the loop body even once.”
spoken · 314s · 2017-03-16