Byte
Long
Float
Double
Object
A and B
C and D
第1题:
下列程序的运行结果为【 】。
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;
}
第2题:
A.Char
B.Byte
C.Float
D.Double
E.Object
第3题:
A.byte
B.long
C.char
D.float
E.Short
F.Long
第4题:
有以下程序 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
第5题:
运行下面程序时,从键盘输入字母H,则输出结果是 #include<stdio.h> main() { char ch; ch=getchar(); switch(ch) { case 'H':printf("Hello!\n"); case 'G':printf("Good morning!\n"); default:printf("Bye_Bye!\n"); } }
A.Hello!
B.Hello! GoodMoring!
C.Hello! Goodmorning! Bye_Bye!
D.Hello! Bye_Bye!
第6题:
有以下程序 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
第7题:
A. Switch(config)# ip default-network 192.168.12.1
B. Switch(config)#ip route-default 192.168.12.1
C. Switch(config)# ip default-gateway 192.168.12.1
D. Swicth(config)# ip route 192.168.12.1 0.0.0.0
第8题:
You need to set the default gateway of one of your TestKing switches. Which command will set the default gateway to 192.168.12.1 on a Cisco switch?()
第9题:
switch (i) { default: System.out.printIn(“Hello”); } What is the acceptable type for the variable i?()
第10题:
switch (i) { default: 310-025 Leading the way in IT testing and certification tools,www.testking.com - 27 - System.out.printIn(“Hello”); } What are the two acceptable types for the variable i? ()
第11题:
Byte
Long
Float
Double
Object
A and B
C and D
第12题:
Char
Byte
Float
Double
Object
第13题:
A.Byte
B.Long
C.Float
D.Double
E.Object
F.AandB
G.CandD
第14题:
classsuper(publicintI=0;publicsuper(stringtext)(I=1))publicclasssubextendssuper(publicsub(stringtext)(i=2)publicstaticvoidmain(straingargs[])(subsub=newsub(Hello”);system.out.PrintIn(sub.i);))Whatistheresult?()
A.Compilationwillfail.
B.Compilationwillsucceedandtheprogramwillprint“0”
C.Compilationwillsucceedandtheprogramwillprint“1”
D.Compilationwillsucceedandtheprogramwillprint“2”
第15题:
A.Char
B.Byte
C.Float
D.Double
E.Object
第16题:
以下程序的输出结果是( )。 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
第17题:
下列程序的输出结果是【 】。
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;
}
第18题:
以下程序的输出结果是( )。
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
第19题:
#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”);
}
第20题:
switch(x) { default: System.out.println(“Hello”); } Which two are acceptable types for x?()
第21题:
switch语句中有无default都行,一般都有,default作用是跳出switch。
第22题:
switch (i) { default: System.out.printIn(“Hello”); ) What are the two acceptable types for the variable i?()
第23题:
Char
Byte
Float
Double
Object
第24题:
byte
long
char
float
Short
Long