下面程序,执行后的结果为
#include "stdio.h"
void fun(int *a,int *b)
{ int k;
k=5;
*a=k;
*b=*a+k;}
main()
{ int *a,*b,x=10,y=15;
a=&x;
b=&y;
fun(a,b);
printf("%d,%d\n",*a,*b);}
A)10,15
B)5,15
C)5,10
D)15,10
(34)阅读下面程序,在程序执行后的结果为
#include "stdio.h"
int *fun(int *a,int *b)
{ int m;
m=*a;
m+=*b-3;
return(&m);}
main()
{int x=21,y=35,*a=&x,*b=&y;
int *k;
k=fun(a,b);
printf("%d\n",*k);}
A)53
B)21
C)35
D)14
(35)已知int a[10];则对a数组元素的正确引用是
A)a[10]
B)a
C)a+5
D)a[10-10]
(36)在C语言中,一维数组的定义方法为
类型说明符 数组名
A)[常量表达式]
B)[整型常量]
C)[整型变量]
D)[整型常量]或[整型表达式]
(37)阅读下列程序,则运行结果为
#include "stdio.h"
fun()
{ static int x=5;
x++;
return x;}
main()
{ int i,x;
for(i=0;i<3;i++)
x=fun();
printf("%d\n",x);}
A)5
B)6
C)7
D)8
(38)下列程序的输出结果是
#include "stdio.h"
#defineM(x,y)x%y
main()
{ int a,m=12,n=100;
a=M(n,m);
printf("%d\n",a--);}
A)2
B)3
C)4
D)5
|