switch (i)  {  default:  System.out.printIn(“Hello”);  )   What are the two acceptable types for the variable i?()  A、 CharB、 ByteC、 FloatD、 DoubleE、 Object

题目

switch (i)  {  default:  System.out.printIn(“Hello”);  )   What are the two acceptable types for the variable i?()  

  • A、 Char
  • B、 Byte
  • C、 Float
  • D、 Double
  • E、 Object

相似考题
更多“switch (i)  {&en”相关问题
  • 第1题:

    下列程序的运行结果为【】。 include void main(void) {int i=10;switch(i){case 9:i=i

    下列程序的运行结果为【 】。

    include<iostream.h>

    void main(void)

    {int i=10;

    switch(i)

    { case 9:i=i+1;

    case 10:i=i+1;

    case 11:i=i+1;

    default:i=i+1;

    }

    cout<<i<<endl;

    }


    正确答案:13
    13

  • 第2题:

    有以下程序 main() { int i; for(i=0;i<3;i++) switch(i) { case 0: printf("%d",i); case 2: printf("%d",i); default: printf("%d",i); } } 程序运行后的输出结果是______。

    A.22111

    B.21021

    C.122

    D.12


    正确答案:C

  • 第3题:

    下列程序的输出结果是【】。 include void main() { inta(5),b(6),i(0)1j(0); switch(a

    下列程序的输出结果是【 】。

    include<iostream.h>

    void main()

    {

    inta(5),b(6),i(0)1j(0);

    switch(a)

    {

    case 5:switch(b)

    {

    case 5:i++;break;

    case 6:j++;break;

    defaun:i++;j++;

    }

    case 6:i++;

    j++;

    break;

    default:i++;j++;

    }

    cout<<i<<","<<j<<endl;

    }


    正确答案:12
    1,2

  • 第4题:

    有以下程序 main() { int i; for(i=0;<3;i++) switch(i) { csse 1: printf("%d",i); case 2: printf("%d",i); default: printf("%d",i); } } 执行后输出结果是

    A.11122

    B.12

    C.12020

    D.120


    正确答案:A
    解析:for循环执行了3次,第一次时i的值为0,执行其后的switch语句,没有匹配的case,执行default语句后的printf语句,输出为0;第二次循环时i的值为1,执行其后的switch语句,与第一个case分支匹配,执行其后的printf语句,输出1,由于没有遇到break语句,所以一直向下执行,又输出了两个1,第三次循环时i值为2,执行其后的switch语句,同理输出两个2。

  • 第5题:

    The network administrator cannot to switch 1 over a telnet session,although the hosts attached to switch 1 can ping the interface Fa0/0 of the router.Given the information in the graphic and assuming that the router and switch2 are configured properly,which of the following commands should be issued on switch 1 to correct this problem?()

    A. Switch1(config)# i nterface fa0 /1 Switch1(config-if)# ip address 192.168.24.3.255.255.255.0

    B. Switch1 (config)#interface fa0/1 Switch1 (config-if)# switchport mode trunk

    C. Switch 1 (config)# i nterface fa0 /1 Switch1 (config-if)# duplex full Switch1 (config-if)# speed 100

    D. Switch1 (config-if)# default-gateway 192.168.24.1

    E. Switch1 (config)# line con 0 Switch1(config-line)# password cisco Switch1 (config-line)#login


    参考答案:D

  • 第6题:

    ɑn、en、ün、in中,前面的ɑ、e、ü、i都是韵腹,n是韵尾。()


    答案:对
    解析:

  • 第7题:

    下面的标记组中,作用不同的有()。

    • A、全部都是
    • B、〈p〉和〈Br〉
    • C、〈I〉〈/I〉和〈Cite〉〈/Cite〉
    • D、〈en〉〈/en〉和〈I〉〈/I〉
    • E、〈strong〉〈/strong〉和〈B〉〈/B〉

    正确答案:B

  • 第8题:

    an、en、ün、in各韵母中,a、e、ü、i都是韵腹,n是韵尾。


    正确答案:正确

  • 第9题:

    How should TCP/IP be configured on the ent0 network adapter?()

    • A、ifconfig en0 192.168.10.1 netmask 255.255.255.0 gateway 192.168.10.254
    • B、ifconfig ent0 192.168.10.1 netmask 255.255.255.0 gateway 192.168.10.254
    • C、mktcpip test61 -a 192.168.10.1 -i en0 255.255.255.0 192.168.10.254 -smktcpip ? test61 -a 192.168.10.1 -i en0 ? 255.255.255.0 ? 192.168.10.254 -s
    • D、mktcpip test61 -a 192.168.10.1 -i ent0 255.255.255.0 192.168.10.254 -smktcpip ? test61 -a 192.168.10.1 -i ent0 ? 255.255.255.0 ? 192.168.10.254 -s

    正确答案:C

  • 第10题:

    单选题
    switch (i) {  default:   System.out.printIn(“Hello”);   }  What is the acceptable type for the variable i?()
    A

     Byte

    B

     Long

    C

     Float

    D

     Double

    E

     Object

    F

     A and B

    G

     C and D


    正确答案: E
    解析: 暂无解析

  • 第11题:

    多选题
    switch (i)  {  default:  System.out.printIn(“Hello”);  )   What are the two acceptable types for the variable i?()
    A

    Char

    B

    Byte

    C

    Float

    D

    Double

    E

    Object


    正确答案: A,C
    解析: 暂无解析

  • 第12题:

    判断题
    an、en、ün、in各韵母中,a、e、ü、i都是韵腹,n是韵尾。
    A

    B


    正确答案:
    解析: 暂无解析

  • 第13题:

    switch(i){default:System.out.printIn(Hello”);)Whatarethetwoacceptabletypesforthevariablei?()

    A.Char

    B.Byte

    C.Float

    D.Double

    E.Object


    参考答案:A, B

  • 第14题:

    以下程序的输出结果是( )。 main { int i; for(i=0;i<3;i++) switch(i){case 0:printf("%d",i); case 2:printf("%d",i); default:printf("%d",i); } }

    A.000102

    B.000020

    C.000122

    D.000111


    正确答案:C
    当i=0时,执行switch语句,对应的执行case0,输出0,因为没有break,接着执行case2的语句,又输出一个0,接着执行default语句,再输出一个0,返回i++;i=1时,没有case语句,执行default语句,输出一个1,接着又返回i++;当i=2时执行case2和default语句分别输出一个2,此时又返回i++,i变为3,for循环不成立,终止,最后输出000122。

  • 第15题:

    有以下程序 #include<stdi0.h> main( ) {int a[]={2,3,5,4),i; for(i=0;i<4;i++) switch(i%2) {case 0:switch(a[i]%2) {case 0:a[i]++;break; case l:a[i]--; }break; case1:a[i]=0; } for(i=0;i<4;i++)printf("%d",a[i]);printf("\n"); } 程序运行后的输出结果是( )。

    A.3344

    B.2050

    C.3040

    D.0304


    正确答案:C
    本题考查嵌套分支语句。共输出4个值:当i=0时,i%2取余后还是0,则执行ease0语句,继续switch语句,此时i为0,数据的下标是从0开始的,a[03的值为2,则a[0]%2=0,继续执行case0,数组a[0]++,值变为3,执行break跳出第二重开关语句。出来后继续执行break,跳出第一重开关语句,继续循环;输出第一个值为3。i++后值为1,i%2=1%2取余后值为1,执行casel,将0赋给a[l],退出开关语句,输出第二个值为0。i++后值为2,i%2=2%2取余后值为0’a[2]的值为5,则a[2]%2=1,继续执行casel,数组a[2]--,值变为4,执行break跳出第二重开关语句。出来后继续执行break,跳出第一重开关语句,继续循环;输出第三个值为4。i++后值为3,i%2=3%2取余后值为1,执行casel,将0赋给a[3],退出开关语句,输出第四个值为0。结果为3040。

  • 第16题:

    以下程序的输出结果是( )。main(){ int i; for(i=0;i<3;i++) switch(i) { case 0:printf(&quo

    以下程序的输出结果是( )。

    main()

    { int i;

    for(i=0;i<3;i++)

    switch(i)

    { case 0:printf("%d",i);

    case 2:printf("%d",i);

    default:printf("%d",i); }

    }

    A.000102

    B.000020

    C.000122

    D.000111


    正确答案:C
    当i=0时,执行switch语句,对应的执行case0,输出0,因为没有break,接着执行case2的语句,又输出一个0,接着执行default语句,再输出一个0,返回i++;i=1时,没有case语句,执行default语句,输出一个1,接着又返回i++;当i=2时执行case2和default语句分别输出一个2,此时又返回i++,i变为3,for循环不成立,终止,最后输出000122。

  • 第17题:

    #include

    main()

    { char str[ ]=“The C program”,c;

    int i;

    for(i=2;(c=str[i])!=‘\0’;i++)

    { switch(c)

    { case ‘g’: ++i; break;

    case ‘o’: continue;

    default: printf(“%c”,c); continue;

    }

    printf(“*”);

    }

    printf(“\n”);

    }


    正确答案:
    4.e C pr*am

  • 第18题:

    SWITCH变流器中查看系统软件版本的面板参数是()

    • A、I6.8.1
    • B、I6.8.3.1
    • C、I6.9.3.1
    • D、I6.7.3.1

    正确答案:B

  • 第19题:

    switch (i)  {  default:  System.out.printIn(“Hello”);  }  What is the acceptable type for the variable i?()  

    • A、 Byte
    • B、 Long
    • C、 Float
    • D、 Double
    • E、 Object
    • F、 A and B
    • G、 C and D

    正确答案:A

  • 第20题:

    Mid(“I am a student.”,9,2)的返回值是什么?()

    • A、“st”
    • B、“nt”
    • C、“tu”
    • D、“en”

    正确答案:C

  • 第21题:

    下面的标记组中,作用相同的有()。

    • A、〈en〉〈/en〉和〈I〉〈/I〉
    • B、全部都是
    • C、〈I〉〈/I〉和〈Cite〉〈/Cite〉
    • D、〈strong〉〈/strong〉和〈B〉〈/B〉
    • E、〈p〉和〈Br〉

    正确答案:A,C,D

  • 第22题:

    多选题
    下面的标记组中,作用相同的有()。
    A

    〈en〉〈/en〉和〈I〉〈/I〉

    B

    全部都是

    C

    〈I〉〈/I〉和〈Cite〉〈/Cite〉

    D

    〈strong〉〈/strong〉和〈B〉〈/B〉

    E

    〈p〉和〈Br〉


    正确答案: D,B
    解析: 暂无解析

  • 第23题:

    单选题
    A System p administrator must change the 9.47.53.0 subnet from 128 addresses to 64  addresses.  How can the AIX systems in the network be permanently modified to accomplish this()
    A

    mktcpip -h hostname -a 9.47.53.x -m 255.255.255.64 -i en0 -g 9.3.230.1

    B

    ifconfig en0 netmask 255.255.255.64

    C

    chdev -l en0 -a netmask=255.255.255.192

    D

    ifconfig en0 netmask 0xffffffc0


    正确答案: D
    解析: 暂无解析