c how to program 习题3.28

发布于2020-05-08 805 热度

运行结果:

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

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