下面程序的输出结果是______。#include int f(char *s){ char *p=s;while(*p!='\0') p++;return(p-s);}int main(){ printf("%d\n",f("ABCDEF"));return 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
若有定义char s[][6]= {"man","woman","girl","boy"};,则以下选项中不能正确输出woman的语句是______。
A. puts(s+1);
B. puts(s[0]+1);
C. printf("%s\n",&s[1][0]);
D. printf("%s\n",s[1]);