重要提示:请勿将账号共享给其他人使用,违者账号将被封禁!
查看《购买须知》>>>
首页 > 计算机应用技术
网友您好,请在下方输入框内输入要搜索的题目:
搜题
拍照、语音搜题,请扫码下载APP
扫一扫 下载APP
题目内容 (请给出正确答案)
[单选题]

int x=3;if(1<=2)if(0)x=4;else x=5;else x=6;执行上述语句后x的值是()。

A.3

B.4

C.5

D.6

答案
查看答案
更多“int x=3;if(1<=2)if(0)x=4;else x=5;else x=6;执行上述语句后x的值是()。”相关的问题

第1题

若有如下语句:int x=3; do { printf(" %d\n",x-=2);} while(!(--x));则上面程序段()。

A.输出的是3和0

B.输出的是1和-2

C.输出的是1

D.是死循环

点击查看答案

第2题

执行以下程序段后,y的值是()。 int a[ ]={1,3,5,7,9}; int x=0,y=1, *ptr; ptr=&a[1]; while(!x) { y+=*(ptr+x); x++; }

A.1

B.2

C.4

D.24

点击查看答案

第3题

若a和b均为int型变量,则执行以下程序断后x的输出是()。 x=15;y=15;printf("%d\n",x%=(y%=2));

A.6

B.12

C.1

D.0

点击查看答案

第4题

已知程序段:int a[3][4],*p[3]={a[0], a[1], a[2]},**pp=p,i;for (i=0; i12; i++)a[i/4][i%4]=i;则pp[1][2]的值是()。

A.3

B.4

C.5

D.6

点击查看答案

第5题

class A {public int getNumber(int a){return a+1;}} class B extends A {public int get
Number(int a, char c){return a+2;} public static void main(String[] args) {B b=new B();System.out.println(b.getNumber(0));} } what is the result?

A.compilation succeeds and 3 is printed

B.compilation succeeds and 2 is printed

C.compilation succeeds and 1 is printed

D.An error at this program cause compilation to fail

点击查看答案

第6题

已知随机变量X的密度为当0

A.1

B.1/2

C.1/3

D.2

点击查看答案

第7题

下列代码中,将引起一个编译错误的行是() 1)public class Test 2)int m,n; 3)public Test()
下列代码中,将引起一个编译错误的行是()

1)public class Test

2)int m,n;

3)public Test()

4)public Test(int a)m=a;

5)public static void main(String args[])

6)Test t1,t2;

7)int j,k;

8)j=0; k=0;

9) t1=new Test();

10)t2=new Test(j,k);

11)

12)

A.第6行

B.第5行

C.第3行

D.第10行

点击查看答案

第8题

publiclass X implements Runnable {publistativoimain(String[] args){3) //在这插入代码} publivoirun() {int x=0, y=0; for (;;) {x++; Y++; System.out.println(“x=”+x+“, y=”+y);}}} 下面哪些代码加在第3行可以使run()运行?()
A.X x=new X(); x.run()

B.X x=new X(); new Thread(x).run()

C.X x=new X(); new Thread(x).start()

D.Threat=new Thread(x).run()

点击查看答案

第9题

下列程序的输出结果是()。 #include void fun(); void main() { int x=1; if(x= =1) { int x=2; printf(“%d”,++x); } void fun() { printf(“%d”,x++);}

A.2,1,1

B.1,2,1

C.2,2,2

D.2,2,1

点击查看答案

第10题

下面程序的输出结果为()。 main() { int a=1,b=0; switch(a) { case 1: switch (b) { case 0: printf("**0**"); break; case 1: printf("**1**"); break; } case 2: printf("**2**"); break; }}

A.有语法错误

B.**0****2**

C.**0****1****2**

D.**0**

点击查看答案

第11题

下列程序的输出结果是()。 #include void fun(); void main() { int x=1; if(x= =1) { int x=2; printf(“%d”,++x); } void fun() { printf(“%d”,x++);}

A.2,2,2

B.2,2,1"

C.2,1,1

D.1,2,1

点击查看答案
下载APP
关注公众号
TOP
重置密码
账号:
旧密码:
新密码:
确认密码:
确认修改
购买搜题卡查看答案 购买前请仔细阅读《购买须知》
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《服务协议》《购买须知》
立即支付 系统将自动为您注册账号
已付款,但不能查看答案,请点这里登录即可>>>
请使用微信扫码支付(元)

订单号:

遇到问题请联系在线客服

请不要关闭本页面,支付完成后请点击【支付完成】按钮
遇到问题请联系在线客服
恭喜您,购买搜题卡成功 系统为您生成的账号密码如下:
重要提示:请勿将账号共享给其他人使用,违者账号将被封禁。
发送账号到微信 保存账号查看答案
怕账号密码记不住?建议关注微信公众号绑定微信,开通微信扫码登录功能
请用微信扫码测试
优题宝