相关疑难解决方法(0)

为什么像(0 <a <5)这样的条件总是正确的?

我在C中实现了以下程序

    #include <stdio.h>
    int main() 
    {
       int a  = 10 ; 
       if(0 < a < 5) 
       {
          printf("The condition is true!") ; 
       }
       return 0 ; 
    }
Run Code Online (Sandbox Code Playgroud)

为什么病情0<a<5总会恢复true

c logic boolean

2
推荐指数
2
解决办法
291
查看次数

c 如何评估小于和大于表达式?

我想知道这段C语言代码中的i是如何计算的?

    int x = 10, y = 20, z = 5, i;
    i = x < y < z;
    printf("%d\n",i);
Run Code Online (Sandbox Code Playgroud)

c evaluation relational-operators

-3
推荐指数
1
解决办法
166
查看次数

标签 统计

c ×2

boolean ×1

evaluation ×1

logic ×1

relational-operators ×1