更多"[单选题]有以下程序
#include “stdio.h”
"的相关试题:
[单选题]有以下程序
#include
void fun(int *x,int i)
{*x=*(x+i);}
void main()
{ int a[8]={1, 2, 3, 4, 5, 6, 7, 8},i;
fun(a,2);
for(i=0; i<8/2; i++)
{ printf("%d",a[i]);}
printf("\n");
}
执行后的输出结果是( )。
A.3234
B.3231
C.2334
D.2331
[单选题]有以下程序
#include
int fun (int x,int y)
{ if (x!=y) return ((x+y);2);
else return (x);
}
main()
{ int a=4,b=5,c=6;
printf("%d\n",fun(2*a,fun(b,c)));
}
程序运行后的输出结果是 ()。
A.3
B.6
C.8
D.12
[单选题]有以下程序
#include
fun(int n, int *s)
{ int f1, f2;
if(n==1||n==2)
*s=1;
else
{ fun(n-1, &f1);
fun(n-2, &f2);
*s=f1+f2;
}
}
void main()
{ int x;
fun(6, &x);
printf("%d\n", x);
}
执行后的输出结果是( )。
A.9
B.8
C.7
D.6
[单选题]有以下程序
#include
void fun(int *s)
{ static int j=0;
do
{ s[j]+=s[j+1];
}while(++j<2);
}
void main()
{ int k,a[10]={1,2,3,4,5};
for(k=1;k<3;k++)
fun(a);
for(k=0;k<5;k++)
printf("%d",a[k]);
}
执行后的输出结果是( )。
A.35756
B.23445
C.35745
D.12345
[单选题]有以下程序
#include
void fun(int *p)
{printf(“%d\n”,p[5]);}
main()
{int a[10]={1,2,3,4,5,6,7,8,9,10};
fun(&a[3]);
程序运行后的输出结果是()。
A.5
B.6
C.8
D.9
[单选题]有以下程序
#include
int fun()
{ static int x=1;
x*=2;
return x;
}
main()
{ int i,s=1;
for(i=1;i<=3;i++) s*=fun();
printf("%d\n",s);
}
程序运行后的输出结果是()。
A.0
B.10
C.30
D.64
[单选题]有以下程序
#include
int fun()
{static int x=1;
x*=2; return x;
}
void main()
{int i,s=1;
for (i=1;i<=2;i++) s=fun();
printf("%d\n",s);
}
执行后的输出结果是( )。
A.1
B.2
C.3
D.4
[单选题]有以下程序
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 fun(int x[],int n)
{static int sum=0,i;
for(i=0;iA.45
B.50
C.60
D.55
[单选题]有以下程序
fun(int x)
{ int p;
if(x==0||x==1) return(3);
p=x-fun(x-2);
return p;
}
main()
{ printf("%d\n",fun(7)); }
执行后的输出结果是( )。
A.7
B.3
C.2
D.0
[单选题]有以下程序
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