For Loops and stopping conditions

前端 未结 4 1777
孤城傲影
孤城傲影 2021-01-29 14:14

Can anyone explain why the answers are what they are please? The first one i guess its because the stopping condition is already reached so it skips the statement but question 1

4条回答
  •  粉色の甜心
    2021-01-29 14:44

    Regarding question 13: there's a semicolon behind the for-loop. Because of that, the loop will first be execuetd until n no longer is > 0 => it is zero then. Then, the print will show a zero.

提交回复
热议问题