1. While: first judge the loop condition, in the execution of the loop body, if the loop condition is not established at the beginning, then the loop body will not be executed
2. do while: execute the loop body first, and judge the loop condition; regardless of whether the loop condition is established, The body of the loop will be executed at least once
The difference between while and do while
Guess you like
Origin blog.csdn.net/jq1223/article/details/112727051
Ranking