新人刚学c,想请教各位大神一个问题
#include <stdio.h>int main ()
{
int a=0;
int b;
while (a<=100)
{
b=a%7;
if(b=0)
{
printf("%d\n",a);
}
else
{
printf("no\n");
}
a=a+1;
}
return 0;
}
为什么最后输出的是一百个no呢,在调试时b=0了但还是执行的else,这是为什么呢???求指导,谢谢
2017-02-07 17:45
2017-02-07 17:51
2017-02-07 18:07
2017-02-08 09:48
2017-02-08 09:48