niusouti.com
更多“阅读下列程序,则在执行后,程序的运行结果为 #include "stdio.h" #include "string.h" main() {ch ”相关问题
  • 第1题:

    当执行下面的程序时,如果输入ABC,写出程序输出结果 #include "stdio.h" #include "string.h" main() { char ss[10]; gets(ss); strcat(ss,"6789"); printf("%sn",ss); }


    A 当执行gets(ss)后,ss数组中的元素为ABC,再执行strcat(ss,″6789″),strcat的作用是把6789连接到ss数组后面,执行完后ss数组为ABC6789,故选择A选项。

  • 第2题:

    3、阅读下列程序,则在执行后,程序的运行结果为()  #include <string.h> #include<stdio.h> int main() { char a[30]="nice to meet you!"; strcpy(a+strlen(a)/2,"you"); printf("%s\n",a); }

    A.nice to meet you you

    B.nice to

    C.meet you you

    D.nice to you


    D 在C中,数据只能从实际参数单向传递给形参。

  • 第3题:

    21、以下程序执行后的结果为 。 #include "stdio.h" #include <string.h> void fun(char *s) { char a[10]; strcpy(a,"string"); s=a; } main() { char *p="gao"; fun(p); printf("%s\n",p); }

    A.gao

    B.结果不确定

    C.str

    D.string


    emoclew emoclew

  • 第4题:

    分析下面程序的运行结果()。 #include "stdio.h" #include "string.h" main() { printf("%dn",strlen("IBMn012")); }


    A 解析:在解答本题时应该考虑两个问题:结构体变量的长度及sizeof()求字节数的运算符。结构体变量的长度是其内部成员总长度之和,本题中,structdate中包含year,month,day三个整型变量。一个整型变量所占的字节数为2。

  • 第5题:

    已知字符B的ACSII码值为66,下面程序的执行结果是: #include<stdio.h> main() { char ch=’A’; printf(“%c %dn”,ch,ch); }


    B