更多"[单选题]以下代码的输出结果是()
string[] words = "的相关试题:
[单选题]以下代码的输出结果是()
int []age = new int[]{16,18,20,14,22};
foreach(int i in age)
{
if(i>18) continue;
Console.Write(i.ToString()+” ”);
}
A.16 18 20 14 22
B.16 18 14 22
C.16 18 14
D.16 18
[单选题]以下代码的输出结果是()
int[] pins = new int[4]{9,2,3,1} ;
Console.WriteLine(pins[1]);
A.1
B.2
C.9
D.3
[单选题]以下代码的输出结果是()
int x = 5;
int y = x--;
Console.Write("y={0},",y);
y = --x;
Console.Write("y={0}", y);
A.5,4
B.y=5,y=4
C.5,3
D.y=5,y=3
[单选题]以下代码的输出结果是()
int a;
a = 25 / 3 % 3;
Console.WriteLine(a);
A.0
B.1
C.2
D.3
[单选题]以下代码的输出结果是()
int x = 5 , y = 2;
float z = x / y;
Console.WriteLine(z);
A.2
B.2.5
C.0
D.语法错误
[单选题]以下代码的输出结果是()
int x=5;
int y = x++;
Console.Write(x);
y=++x;
Console.Write(y);
A.56
B.57
C.67
D.66
[单选题]以下代码的输出结果是()
int x=5;
x += x++ + ++x;
Console.WriteLine(x);
A.16
B.17
C.25
D.26
[单选题]以下代码的输出结果是()
int[] a = { 1, 2, 3, 4, 5, 6, 7, 8 };
int s0, s1, s2;
s0 = s1 = s2 = 0;
for (int i = 0; i < 8; i++)
{
switch (a[i] % 3)
{
case 0: s0 += a[i]; break;
case 1: s1 += a[i]; break;
case 2: s2 += a[i]; break;
}
}
Console.WriteLine(s0+""+s1+""+s2);
A.36
B.9
C.91215
D.以上都不是
[单选题]ET中,下列代码在页面中的输出结果是(选一项)
XmlDocument xd = new XmlDocument();
xd.LoadXml("
诸葛亮");
Response.Write(xd.InnerText);
A.诸葛亮
B.
C.
诸葛亮D.
诸葛亮
[单选题]在ADO.NET中,下列代码运行后的输出结果是() 代码:
DataTable dt=new DataTable();
dt.Columns.Add (“编号”,typeof(System.Int16));
dt.Columns.Add (“成绩”,typeof(System.Single));
Console.WriteLine(dt.Columns[1].DataType);
A.System.Int16
B.System.Single
C.编号
D.成绩
[单选题]以下代码能输出"OK"的代码是(选一项)
A.declare @num nvarchar(10)
@num = ‘OK’
Print @num
B.declare @num nvarchar(10)
@num = ‘OK’
Select @num
C.If( true )
Print ‘OK’
D.If( 1=1 )
Select ‘OK’
[单选题]下列代码的输出结果是()
public class Foo {
public static void main(String[] args) {
try {
return;
} finally {
System.out.println("Finally");
}
}
}
A.Finally
B.编译失败
C.代码正常运行但没有任何输出
D.运行时抛出异常
[单选题]下列代码输出结果是()
int i=10;
while(i>0){
i=i+1;
if(i==10){
break;
}
}
A.while循环执行10次
B.死循环
C.循环一次都不执行
D.循环执行一次
[单选题]下面代码的输出结果是
X = 12.34
Print(type(x))()
A.
B.
C.
D.
[单选题]分析下面的Javascript代码段,输出结果是()var mystring=”I am a student”;
var a=mystring.substring(9,13);
document.write(a);
A.stud
B.tuden
C.uden
D.udent
[单选题]下面代码的输出结果是
For s in “HelloWorld”:
If s==“W”:
Continue
Print(s,end="")()
A.Hello
B.World
C.HelloWorld
D.Helloorld
[单选题]下面代码的输出结果是s =[“seashell”,“gold”,“pink”,“brown”,“purple”,“tomato”]print(s[1:4:2])()
A.[‘gold’, ‘pink’, ‘brown’]
B.[‘gold’, ‘pink’]
C.[‘gold’, ‘pink’, ‘brown’, ‘purple’, ‘tomato’]
D.[‘gold’, ‘brown’]
[单选题]分析下面的javascript代码段,输出结果是()
var s1=parseInt("101 中学");
document.write(s1);
A.NaN
B.101 中学
C.101
D.出现脚本错误
[单选题]如果 x=35, y=100,下面代码的输出结果是( )
if (x < 20 || x > 30)
{
if (y >= 100)
{
Console.WriteLine("危险 ");
}
else
{
Console.WriteLine("报警 ");
}
}
else
{
Console.WriteLine("安全 ");
}
A.危险
B.报警
C.报警 安全
D.危险 安全