讲解for循环

    xiaoxiao2021-12-14  55

    for(初始化;表达式;后执行语句){}

    #include <stdio.h> int main(void) { int i; for(i=0,printf("First=%d",i); printf("Second=%d",i),i<10; ++i,printf("Third=%d",i)) { printf("Fourth=%d",i); } } 执行结果:

    First=0 Second=0Fourth=0Third=1 Second=1Fourth=1Third=2 Second=2Fourth=2Third=3 Second=3Fourth=3Third=4 Second=4Fourth=4Third=5 Second=5Fourth=5Third=6 Second=6Fourth=6Third=7 Second=7Fourth=7Third=8 Second=8Fourth=8Third=9 Second=9Fourth=9Third=10 Second=10

    转载请注明原文地址: https://ju.6miu.com/read-962830.html

    最新回复(0)