运行结果:
C语言代码:
/* c how to program 习题3.37 */
#include <stdio.h>
// function main begins program execution
int main( void )
{
//定义变量 number
int number = 0;
//当number为1-100时执行循环
while(number++ < 100){
//打印*每10个换一行
(number % 10 != 0) ? printf("*") : printf("*\n");
}
}