C语言基础:for从大到小循环语句范例的代码

it2025-12-25  15

下面的代码内容是关于C语言基础:for从大到小循环语句范例的代码,应该能对各位有些用处。

#include <stdio.h>

int main () { int counter;

for (counter = 5; counter >= 1; counter--) printf("%d ", counter);

printf("nStarting second loopn"); for (counter = 10; counter >= 1; counter--) printf("%d ", counter);

printf("nStarting third loopn");

for (counter = 0; counter >= 1; counter--) printf("%d ", counter);

return 1; }

 

gcc编译运行结果

5 4 3 2 1 Starting second loop10 9 8 7 6 5 4 3 2 1 Starting third loop

转载于:https://www.cnblogs.com/codeoldman/p/10338529.html

相关资源:各显卡算力对照表!
最新回复(0)