设有定义:double x[10],*p=x;,以下能给数组x下标为6的元素读入数据的正确语句是( )。
A. scanf("%f",&x[6]);
B. scanf("%lf",*(x+6));
C. scanf("%lf",p+6);
D. scanf("%lf",p[6]);
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346528.html
点击查看答案
C语言中,数组名代表()。
A. 数组全部元素的值
B. 数组首地址
C. 数组第一个元素的值
D. 数组元素的个数
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346503.html
点击查看答案
有以下程序
main()
{int y=10;
while(y--);printf("y=%d\n",y);
}
程序执行后的输出结果是()。
A. y=0
B. y=-1
C. y=1
D. while构成无限循环
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346510.html
点击查看答案
main()
{ int x=3,i;
for(i=0;i<3;i++) printf("%d",f(x));
}
int f(int a)
{ int b=0;
static c=3;
b++;c++;
return(a+b+c);
}
执行此程序后屏幕上显示的结果是()。
A. 8 10 10
B. 7 9 10
C. 8 9 11
D. 8 9 10
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e034650e.html
点击查看答案
以下函数的功能是:通过键盘输入数据,为数组中的所有元素赋值。
#include
#define N 10
void fun(int x[N])
{ int i=0;
while (i scanf("%d",______);
}
在程序中下划线处应填入的是( )。
A. x+i
B. &x[i+1]
C. x+(i++)
D. &x[++i]
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346520.html
点击查看答案
有以下程序
void swap(char *x,char *y)
{char t;
t=*x; *x=*y; *y=t;
}
main()
{char *s1="abc",*s2="123";
swap(s1,s2);printf("%s,%s\n",s1,s2);
}
程序执行后的输出结果是()。
A. 123,abc
B. abc,123
C. 1bc,a23
D. 321,cba
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346516.html
点击查看答案
若i和k都是int类型变量,有以下for语句
for(i=0,k=-1;k=1;k++) printf("*****\n");
下面关于语句执行情况的叙述中正确的是( )。
A. 循环体执行两次
B. 循环体执行一次
C. 循环体一次也不执行
D. 构成无限循环
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346527.html
点击查看答案
有以下程序
#include "stdio.h"
main()
{ int a,b,c=246;
a=c/100%9;
b=(-1)&&(-1);
printf("%d,%d\n",a,b);
}
输出结果是()。
A. 2,1
B. 3,2
C. 4,3
D. 2,-1
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346515.html
点击查看答案
有如下定义
struct person{char name[9]; int age;};
strict person class[10]={"Johu", 17,
"Paul", 19
"Mary", 18,
"Adam 16,};
根据上述定义,能输出字母M的语句是()。
A. prinft("%c\n",class[3].mane);
B. pfintf("%c\n",class[3].name[1]);
C. prinft("%c\n",class[2].name[1]);
D. printf("%^c\n",class[2].name[0]);
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346501.html
点击查看答案
有以下程序
#include
#define FUN1(a,b) a+b
#define FUN2(a,b) a-b
#define CAL(a,b) a*b+a+3
main()
{
printf("%d\n",CAL(FUN1(3,5),FUN2(4,5)));
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346521.html
点击查看答案