单项选择题

下面程序的输出结果是()。
#include<string.h>
main()
char*p1="abc",*p2="ABC",s[20]="xyz";
strcpy(s+1,p2);
strcat(s+2,p1);
printf("%s\n",s);

A、 xABCabc
B、 zABCabc
C、 yzabcABC
D、 xyzABCabc

<上一题 目录 下一题>
热门 试题

单项选择题
函数调用:strcat(strcpy(str1,str2,),str3)的功能是()

A、将串str1复制到串str2中后再连接到串str3之后
B、将串str1连接到串str2之后再复制到串str3之后
C、将串str2连接到串str1之后再将串str3连接到串str1之后
D、将串str2连接到串str1之后再将串str1连接到串str3之后

单项选择题
若有定义:float x=1.5;int a=1,b=3,c=2;,则正确的switch语句是()

A、 switch(x)
case 1.0: printf("*\n");
case 2.0: printf("**\n");
B、 switch (int)x);
case1: printf("*\n");
case 2: printf("**\n");
C、 switch(a+b)
case 1: printf("*\n");
case 2+1: printf("**\n");
D、 switch(a+b)
case 1: printf("*\n");
case c: printf("**\n");

相关试题
  • 以下程序中C的二进制值是()。 char a=...
  • 有以下程序: #include<stdio.h> mai...
  • 以下叙述中正确的是()
  • 以下选项中可用做C程序合法实数的是()。
  • 以下程序运行后,输出结果是()。 main(...