运行结果:
C语言代码:
/* c how to program 习题3.28 */
#include <stdio.h>
// function main begins program execution
int main( void )
{
//初始化变量count为0
int count = 0;
//当count少于10执行循环
while( count++ < 10 ){
//如果coute取余2=1就打印****,否则打印++++++++
puts(count % 2 ? "****" : "++++++++");
}
} // end function main