微信搜索关注"91考试网"公众号,领30元,获取公务员、事业编、教师等考试资料40G!
} A.a=true =fale =true c=faleB.a=true =fale =true c=trueC.a=true =true =true c=faleD.a=fale =fale =true c=fale 参考答案: C 本题考查关系运算符<和==。题目中a=(3<5);比较3和5的大小,因为3<5,返回true给a:b=(a==true);判断a是否为真,因为a确实为真,返回true给b; c =(b==false);判断b是否为假,因为b不为假,返回false给c。最后结果a=true,b==true, b=true,c=false,选 项C正确。----------------------------------------35、 下面程序段的输出结果是 public class Test { public static void main(String args []){ int a,b; for(a=1,b=1;a<100;a++){ if(b>=10)break; if(b%2==1){ b+=2; continue; } } System.out.println(a) ; } } A.5B.6C.7D.101 参考答案: B 本题考查for循环和if语句的嵌套以及break语句和continue语句的用法。 第1个if语句的意义为:当b>=10时退出for循环,第2个if语句的意义为:如果 b%2=1,则b的值加2井退出本次循环。本程序当b的值分别 为1、3、5、7和9的时候执行5次循环,此时a=5,b=9,当执行第6次循环时,a的值为6但b=11,所以退出循环,程序结束。