【发布时间】:2017-11-06 21:48:12
【问题描述】:
// How does this program work with ternary operator
#include <stdio.h>
int main()
{
int x = 2, y = 5;
(x & y) ? printf("True ") : printf("False "); // How do we get output
(x && y) ? printf("True ") : printf("False ");
return 0;
}
这个程序是如何工作的? 逻辑运算符和位运算符是如何工作的?
【问题讨论】:
-
输出:假和真
-
@manjunathhiremath 你的问题解决了吗?
标签: c bitwise-operators ternary-operator