实例 C++逻辑与运算符

x
 
#include <iostream>
using namespace std;
int main() {
  int x = 5;
  int y = 3;
  cout << (x > 3 && x < 10); // returns true (1) because 5 is greater than 3 AND 5 is less than 10
  return 0;
}
                    

输出结果

1