search

Home  >  Q&A  >  body text

for循环是不是和do while循环一样都是先执行?

橱窗的光橱窗的光2902 days ago1293

reply all(2)I'll reply

  • 数据分析师

    数据分析师2017-09-30 22:44:07

    Is the for loop executed first like the do while loop? -PHP Chinese website Q&A-Is the for loop executed first like the do while loop? -PHP Chinese website Q&A

    Please watch and learn.

    reply
    0
  • 迷茫

    迷茫2016-12-17 13:42:37

    for(表达式1;表达式2;表达式3){

    循环代码

    }

    先执行表达式1和表达式2 ,再到表达3去判断

    do{

    循环代码

    }while(条件)

    而do while 则是先执行一次,到while时在判断


    reply
    1
  • Cancelreply