题目内容

若有以下程序 #include main() { char a[20], b[ ]="The sky is blue."; int i; for (i=0; i<10; i++) scanf("%c", &a[i]); a[i]='\0'; gets(b); printf("%s%s\n", a,b); } 执行时若输入:Fig flower is red. 回车则输出结果是______。

A. Fig flower is red.
B. Fig flower is red.is blue.
C. Fig floweris red.
D. Fig floweris

查看答案
更多问题

若有以下程序 #include main() { char a[20], b[ ]="The sky is blue."; int i; for (i=0; i<7; i++) scanf("%c", &b[i]); gets(a); printf("%s%s\n", a,b); } 执行时若输入: (其中Enter表示回车符)Fig flower is red. 回车则输出结果是______。

A. wer is red.Fig flo is blue.
B. wer is red.Fig flo
C. wer is red.The sky is blue.
D. Fig flower is red.The sky is blue.

有以下说明语句char *s = "\"Name\\Address\n";指针s所指字符串的长度是______。

A. 14
B. 15
C. 17
D. 说明语句不合法

若有以下程序 #include main() { int i,j=0; char a[]="How are you!"; for (i=0; a[i]; i++) if (a[i] != ' ') a[j++]=a[i]; a[j]='\0'; printf("%s\n",a); } 则程序的输出结果是______。

A. Howareyou
B. Howareyou!
C. Hay!
D. How are you!

若有定义:char c="hello!";,则以下说法正确的是______。

A. 定义中有语法错误
B. c是一个字符串变量
C. c占用7字节内存
D. c的有效字符个数是6

答案查题题库