下面是一个简单的循环,输出数字0到9:

#include <stdio.h>

int main() {
    int i;
    for (i = 0; i < 10; i++) {
        printf("%d\n", i);
    }
    return 0;
}

这个循环使用了for循环结构,在每次循环中输出变量i的值。循环从0开始,每次增加1,直到i达到10为止。循环体中的语句使用了printf函数,将i的值输出到屏幕上。

用C语言写一个循环

原文地址: https://www.cveoy.top/t/topic/g8U3 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录