已知char a[3][10]={"hefei", "anqing","huangshan"};,能正确显示字符'q'的语句是______。
A. printf("%c",a[1][2]);
B. printf("%c",a[2][2]);
C. printf("%c",a[1][3]);
D. printf("%c",a[2][3]);
查看答案
下面程序的输出结果是______。#include int f(char *s){ char *p=s;while(*p!='\0') p++;return(p-s);}int main(){ printf("%d\n",f("ABCDEF"));return 0;}
A. 3
B. 6
C. 8
D. 0
已知char c[5]={'a', 'b', '\0', 'c', '\0'};则printf(“%s\n”,c);语句的执行结果是_______ 。
A. 'a' 'b'
B. ab
C. abc
D. ab\0c\0
下列不能输出字符串的程序段是_______。
A. char *t;t="Hello";printf("%s\n",t);
B. char *t, s[ ]="Hello";t=s;printf("%s\n",t);
C. char s[20], *t=s;t="Hello";printf("%s\n",s);
D. char *t, s[ ]="Hello";t=s;printf("%s\n",s);
执行下列程序,输出结果是______ 。#include int main(){ char arr[2][4];strcpy(arr,"you");strcpy(arr[1],"me");arr[0][3]='&';printf("%s\n",arr);return 0;}
A. you&me
B. you C) D)
C. me
D. arr