15.以下不能对一维数组a进行正确定义及初始化的语句是______。
A. int a[5]={ };
B. int a[5]={1};
C. int a[5]={1,2};
D. int a[5]={1,2,3,4,5};
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-95b0-c044-ce3414c8e900.html
点击查看答案
17.以下程序段的输出结果是______。
char s[]="Hello World!";
strlwr( );
printf( );
A. hello world!
B. HELLO world!
C. hello WORLD!
D. HELLO WORLD!
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-9398-c044-ce3414c8e901.html
点击查看答案
18.max函数的功能是求整型数组a中前n个元素中的最大值。下列函数声明语句中错误的是______。
A. int max(int *a,int n);
B. int max(int a[10],int n);
C. int max(int a,int n);
D. int max(int a[ ],int n);
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-4190-c044-ce3414c8e900.html
点击查看答案
23.设有:
#define ADD( ) x+y
则语句
printf("s=%d", 5*ADD(4,3));
的输出结果是______。
A. s=35
B. s=12
C. s=23
D. s=17
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-a550-c044-ce3414c8e901.html
点击查看答案
17.设有char s[2][10]={"12","34"};,则数组s占用______个字节。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-43a8-c044-ce3414c8e901.html
点击查看答案
12.设n为整型变量,执行语句for(n=1;n++<4;);后,变量n的值是______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-8de0-c044-ce3414c8e901.html
点击查看答案
15.设有定义:int a[5];,则对a数组元素引用不正确的是______。
A. a[5]
B. a[3*1]
C. a[10-10]
D. a[3+1]
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-8fb0-c044-ce3414c8e900.html
点击查看答案
12.执行下列程序后,输出的结果是______。
#include
void main( )
{
int i,s=0;
for(i=1;i<10;i+=2)
s+=i+1;
printf( );
}
A. s=30
B. s=25
C. s=55
D. s=45
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-e3d0-c044-ce3414c8e900.html
点击查看答案
18.已知主调函数中有以下定义及声明:
int a=1,b=2;float fun( );
则在主调函数中可以正确调用此函数的语句是______。
A. fun(a);
B. fun(a,&b);
C. fun(*a,*b);
D. fun(&a,a+b);
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fa-e9d0-c044-ce3414c8e901.html
点击查看答案
9.设有以下语句:char c1,c2;scanf("%c%c",&c1,&c2);,若要为变量c1和c2分别输入字符A和B,正确的输入形式应该是______。
A. A和B之间用逗号分隔
B. A和B之间不能有任何分隔符
C. A和B之间可以用回车分隔
D. A和B之间用空格分隔
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-89f8-c044-ce3414c8e900.html
点击查看答案