c how to program 习题4.21

发布于2020-08-31 968 热度

运行结果:

C语言代码:

//C how to program 习题4.20
//按要求修改4.2的循环程序
#include<stdio.h>
int main(void){
    //initialization, iteration condition, and increment
    //are all included in the for statement header.
    unsigned int counter = 0;
    for (; counter < 10; printf("%u\n", counter)){
        counter++;
    }
}

记录工作,记录学习,分享知识,分享经验……