有以下程序 #include main() { char str[]={"123456"}; str++; printf( "%c\n", str[1] ); } 程序编译或运行时将会______。
A. 输出字符串3456
B. 输出字符2
C. 输出字符3
D. 产生错误信息
查看答案
若有以下程序 #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!