问题
填空题
下面程序的结果为【 】。 #include<iostream.h> void main( ) { int a=1,b=2; bool c=1; if((a>b)||c) cout<<"true"<<endl; else cout<<"false"<<endl; }
答案
参考答案:True
解析:本题考查的是对于逻辑运算符号的理解,“||”运算符的任何一边取值为真, 则整个运算结果为真。
下面程序的结果为【 】。 #include<iostream.h> void main( ) { int a=1,b=2; bool c=1; if((a>b)||c) cout<<"true"<<endl; else cout<<"false"<<endl; }
参考答案:True
解析:本题考查的是对于逻辑运算符号的理解,“||”运算符的任何一边取值为真, 则整个运算结果为真。