更多"[单选题]有以下程序Fun(int x){ int p;If(x="的相关试题:
[单选题]有以下程序
int fun(int x,int y,int *cp,int *dp)
{ *cp=x+y; *dp=x-y; }
main()
{ int a, b, c, d;
a=30; b=50;
fun(a,b,&c,&d);
printf("%d,%d\n", c, d);
}
输出结果是()。
A.50,30
B.30,50
C.80,-20
D.80,20
[单选题]有以下程序
Int f1(int x,int y)
{ return x>y?x:y; }
Int f2(int x,int y)
{ return x>y?y:x; }
Main()
{int a=4,b=3,c=5,d,e,f;
D=f1(a,b); d=f1(d,c);
E=f2(a,b); e=f2(e,c);
F=a+b+c-d-e;
Printf("%d,%d,%d\n",d,f,e);
}
执行后输出的结果是()。
A.3,4,5
B.5,3,4
C.5,4,3
D.3,5,4
[单选题]有以下程序
int fun(int x[],int n)
{static int sum=0,i;
for(i=0;iA.45
B.50
C.60
D.55
[单选题]有以下程序
Int f1(int x,int y){return x>y?x:y;}
Int f2(int x,int y){return x>y?y:x;}
Main()
{
Int a=4,b=3,c=5,d=2,e,f,g;
E=f2(f1(a,b),f1(c,d));
F=f1(f2(a,b),f2(c,d));
G=a+b+c+d-e-f;
Printf("%d,%d,%d\n",e,f,g);
}
程序运行后的输出结果是()。
A.4,3,7
B.3,4,7
C.5,2,7
D.2,5,7
[单选题]有以下程序
Void f(int x,int y)
{ int t;
If(x}
Main()
{ int a=4,b=3,c=5;
F(a,b); f(a,c); f(b,c);
Printf("%d,%d,%d\n",a,b,c);
}
执行后输出的结果是()。
A.3,4,5
B.5,3,4
C.5,4,3
D.4,3,5
[单选题]有以下程序
Void f(int *x,int *y)
{
Int t;
T=*x;*x=*y;*y=t;
}
Main()
{
Int a[8]={1,2,3,4,5,6,7,8},i,*p,*q;
P=a;q=&a[7];
While(p{ f(p,q);p++;q--;}
For(i=0;i<8;i++) printf("%d,",a[i]);
}
程序运行后的输出结果是()。
A.8,2,3,4,5,6,7,1,
B.5,6,7,8,1,2,3,4,
C.1,2,3,4,5,6,7,8,
D.8,7,6,5,4,3,2,1,
[单选题]有以下程序
Int *f(int *x,int *y)
{ if(*x<*y)
Return x;
Else
Return y;
}
Main()
{ int a=7,b=8,*p,*q,*r;
P=&a; q=&b;
R=f(p,q);
Printf("%d,%d,%d\n",*p,*q,*r);
}
执行后输出结果是()。
A.7,8,8
B.7,8,7
C.8,7,7
D.8,7,8
[单选题]有以下程序
fun(int x)
{int p;
if(x==0║x==1) return(3);
p=x-fun(x-2); return p; }
main()
{ prinf("%d\n",fun(7));}
执行后的输出结果是()。
A.7
B.3
C.2
D.0
[单选题]有以下程序
Fun (int x, int y)
{ static int m=0,i=2;
I+=m+1; m=i+x+y; return m;
}
Main()
{ int j=1,m=1,k;
K=fun(j,m); printf("%d,",k);
K=fun(j,m); printf("%d\n",k);
}
执行后的输出结果是()。
A.5,5
B.5,11
C.11,11
D.11,5
[单选题]有以下程序
fun(int x,int y)
{static int m=0,i=2; i+=m+1;m=i+x+y; return m; }
main()
{int j=1,m=1,k;
k=fun(j,m); printf("%d,",k);
k=fun(j,m);
printf("%d\n",k);
}
执行后的输出结果
A.5,5
B.5,11
C.11,11
D.11,5
[单选题]有以下程序
Fun(int x, int y)
{return(x+y);}
Main()
{ int a=1,b=2,c=3,sum;
Sum=fun((a++,b++,a+b),c++);
Printf("%d\n",sum);
}
执行后的输出结果是()。
A.6
B.7
C.8
D.9
[单选题]有以下程序
fun(int x,int y){return(x+y);}
main()
{int a=1,b=2,c=3,sum;
sum=fun((a++,b++,a+b),c++);
printf("%d\n",sum); }
执行后的输出结果是()。
A.6
B.7
C.8
D.9
[单选题]有以下程序段
struct st
{int x;int *y;}*pt;
int a[]={1,2},b[]={3,4};
struct st c[2]={10,a,20,b};
pt=c;
以下选项中表达式的值为11的是()。
A.*pt->y
B.pt->x
C.++pt->x
D.(pt++)->x
[单选题]有以下程序:
Float fun(int x,int y)
{return(x+y); }
Main()
{int a=2,b=5,c=8;
Printf("%3.0f\n",fun((int)fun(a+c,b),a-c));
}
程序运行后的输出结果是()。
A.编译出错
B.9
C.21
D.9.0
[单选题]有以下程序
#include
Int f(int x)
{ int y;
If(x==0||x==1) return(3);
Y=x*x-f(x-2);
Return y;
}
Main()
{ int z;
Z=f(3); printf("%d\n",z);
}
程序的运行结果是()。
A.0
B.9
C.6
D.8
[单选题]以下程序的输出是()。
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
[单选题]有以下程序段
Struct st
{int x;int *y;}*pt;
Int a[]={1,2},b[]={3,4};
Struct st c[2]={10,a,20,b};
Pt=c;
以下选项中表达式的值为11的是()。
A.*pt->y
B.pt->x
C.++pt->x
D.(pt++)->x
[单选题]以下程序代码块,描述正确的是?
int x=-1;
do
{
x = x * x;
}while(x==0);
A.死循环
B.循环体执行2次
C.循环体执行1次
D.语法错误
[单选题]以下程序代码运行的结果是?
for (int x = 10; x > 3; x--)
{
if (x % 3!=0) x--;
--x; --x;
Console.WriteLine(x);
}
A.63
B.74
C.62
D.73