更多"[单选题]以下代码的输出结果是()
int[] pins = new "的相关试题:
[单选题]以下代码的输出结果是()
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 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 x=5;
int y = x++;
Console.Write(x);
y=++x;
Console.Write(y);
A.56
B.57
C.67
D.66
[单选题]以下代码的输出结果是()
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;
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.以上都不是
[单选题]以下代码的输出结果是()
string[] words = new string[] { "a", "b", "c" };
foreach (int word in words)
{
word ="abc";
Console.WriteLine(word);
}
Console.ReadKey();
A.a b c
B.abc abc abc
C.bc ac ab
D.不能正确编译
[单选题]以下程序输出正确的是()。
Amovep(int *p,int (*a)[3],int n)
{ int i,j;
For(i=0;iFor(j=0;j}
Main()
{ int *p,a[3][3]={{1,3,5},{2,4,6}};
P=(int*)malloc(100);
Amovep(p,a,3);
Printf("%d%d\n",p[2],p[5]);free(p);
}
A.56
B.25
C.34
D.程序错误
[单选题]以下程序的输出结果是()。
F(int b[],int m,int n)
{ int i,s=0;
For(i=m;iReturn s;
}
Main()
{int x,a[]={1,2,3,4,5,6,7,8,9};
X=f(a,3,7);
Printf("%d\n",x);
}
A.10
B.18
C.8
D.15
[单选题]以下程序的输出结果是()。
Int f( )
{ static int i=0;
Int s=1;
S+=i; i++;
Return s;
}
Main()
{ int i,a=0;
For(i=0;i<5;i++) a+=f( );
Printf("%d\n",a);
}
A.20
B.24
C.25
D.15
[单选题]以下代码能输出"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’
[单选题]以下程序的输出是()。
Struct st
{ int x; int *y;} *p;
Int dt[4]={10,20,30,40};
Struct st aa[4]={50,&dt[0],60,&dt[0],60,&dt[0],60,&dt[0],};
Main()
{ p=aa;
Printf("%d\n",++(p->x));
}
A.10
B.11
C.51
D.60
[单选题]下列代码输出结果是()
int i=10;
while(i>0){
i=i+1;
if(i==10){
break;
}
}
A.while循环执行10次
B.死循环
C.循环一次都不执行
D.循环执行一次
[单选题]以下程序的输出结果是()。
func(int a,int b)
{ int c;
c=a+b;
return c;}
main( )
{ int x=6,y=7,z=8,r=0;
r=func((x--,y++,x+y),z--);
printf(“%d\n”,r);}
A.11
B.20
C.21
D.31
[单选题]若int类型占两个字节,则以下语句输出为()。
int k=-1;
printf("%d,%u\n",k,k);
A.-1,-1
B.-1,65536
C.-1,32768
D.-1,65535
[单选题]在C#中,执行完代码int [ ] x = new int[10];后,下列说明正确的是( )
A.x[9]为0
B.x[9]未定义
C.x[10]为0
D.x[0]为空
[单选题]下述C#语言代码的运行结果是()。
int[][] myArray3=new int[3][]
{
new int[3]{5,6,2},
new int[5]{6,9,7,8,3},
new int[2]{3,2}
};
myArray3[2][2]的值是()
A.9
B.2
C.6
D.数组索引超出界限