c语言的的&& 和|| 用的时候有什么错误的用法不容易 发现?

a=1,b=1,c=1;
if((a==1)&&(b==1)&&(c==1))
printf("ok");
else
printf("no");
为什么输出的是 no?

#include <stdio.h>
int main()
{
int a=1,b=1,c=1;
if( (1==a)
  &&(1==b)
  &&(1==c))
{
printf("ok");
}
else
{
printf("no");
}
}

//在判断的时候,把变量和数字的位置换一下,这样可以避免==写成=的错误。

温馨提示:答案为网友推荐,仅供参考
相似回答