6.3 程序改错题

来源:互联网 发布:顺德容桂电商美工助理 编辑:程序博客网 时间:2024/05/17 02:01
#include <stdio.h>#include <stdlib.h>int main(){    int x=1,find=0;    while (!find)    {        if(x%2==1&&x%3==2&&x%5==4&&x%6==5&&x%7==0)        {            printf("x=%d\n",x);            find=1;        }        x++;    }    return 0;}

这里写图片描述
总结:while的后面没有“;”。 在c语言程序中“等于”的符号是“==”。“x++”的位置应如上述位置。