如下代码片段的输出是什么? char str[13] = "hello world!";char *p;p = str;while (*p != ' ') { printf ("%c", *p - 'a' + 'A'); p++;}
A: hello world!
B: HELLOWORLD
C: HELLO world!
D: HELLO
A: hello world!
B: HELLOWORLD
C: HELLO world!
D: HELLO
举一反三
- 下面程序的运行结果为____。void main(){ char *p,*q;char str[]="Hello,World\n";q=p=str; p++;printf("%s\n",q);printf("%s\n",p); }
- 如下代码片段的输出是什么?char str[]="DLXComputer";char *p;p = str;while ( *p != 0 ) { printf( "%c", *p + 1 ); p++; }
- 中国大学MOOC: 如下代码片段的输出是什么?char str[]=DLXComputer;char *p;p = str;while ( *p != 0 ) { printf( %c, *p + 1 ); p++; }
- 如何将字符串“Hello World”写入a.txt文件内?FILE *file; file = fopen("a.txt","w"); A: char str = "Hello World"; fputs(&str,file); B: char str = "Hello World"; fputc(&str,file); C: char str = "Hello World"; fput(&str,file); D: char str = "Hello World"; fputs(str,file);
- 以下程序段的输出结果是 。Char s[ ]=”Hello World!”;Strlwr(s);Printf(“%s”,s); A: hello world! B: HELLO world! C: hello WORLD! D: HELLO WORLD!