niusouti.com

请读程序: includef(char * s){cahr * p=s;while(* p!='\0')p++;return(p-s);}main(){请读程序: # include<stdio.h> f(char * s) {cahr * p=s; while(* p!='\0')p++; return(p-s); } main() {printf("%d\n”,f("ABCDEF"));} 上面程序的输出结果是 ( )A.3B.6C.8D.0

题目
请读程序: includef(char * s){cahr * p=s;while(* p!='\0')p++;return(p-s);}main(){

请读程序: # include<stdio.h> f(char * s) {cahr * p=s; while(* p!='\0')p++; return(p-s); } main() {printf("%d\n”,f("ABCDEF"));} 上面程序的输出结果是 ( )

A.3

B.6

C.8

D.0


相似考题
更多“请读程序:# include<stdio.h>f(char * s){cahr * p=s;while(* p!='\0')p++;return(p-s);}main(){ ”相关问题
  • 第1题:

    有如下的程序: int f(char*s) { char *p=s; while(*p!='\0') p++; return(p-s); }如果在主程序中用下述语句调用上述函数,则输出结果为______。 printf("%d\n",f("best one!"));

    A.3

    B.6

    C.8

    D.9


    正确答案:D
    解析:函数f的功能实际上是统计字符串s的字符数,“bestone!”共9个字符,所以选D。

  • 第2题:

    请读程序: includeChar fun(char*c)(if(c<='z'& & * c>='A') * c-='A'-'a'ret

    请读程序: # include<stdio.h> Char fun(char*c) (if(c<='z'& & * c>='A') * c-='A'-'a' return * c; } main() { char s[81],* p=s; gets(s); while(* p) { * p=fun(p);putchar(* p);p + +; puchar('\n'); } 若运行时从键盘上输入OPEN THE DOOR <CR>(<CR>表示回车),则上面程序的输出结果是 ( )

    A.oPEN tHE dOOR

    B.ope the door

    C.OPEN THE DOOR

    D.Open The Door


    正确答案:B

  • 第3题:

    以下程序运行后的输出结果是______。 ss(char*s) { char*p=s; while(*p)p++; return(p-s); } main() { char*a="abded";int i; i=ss(a); printf("%d\n",i); }

    A.8

    B.7

    C.6

    D.5


    正确答案:D

  • 第4题:

    以下程序的输出结果是()。includeint fun (char*s){char *p=s;while (*p!='\0,) p++

    以下程序的输出结果是( )。 #include<iostream.h> int fun (char*s) { char *p=s; while (*p!='\0,) p++: return (p-s): } void main() { cout<<fun (" ABCDEF ")<<endl: }

    A.3

    B.6

    C.8

    D.0


    正确答案:B

  • 第5题:

    以下程序运行后,输出结果是()includess(char*s){char*p=s; while(*p)p++ return(p-s);

    以下程序运行后,输出结果是( ) #include<stdio.h> ss(char *s) { char*p=s; while(*p) p++ return(p-s); } main() { char *a="abded" int i; i=ss(a) ; printf("%d\n",i); }

    A.8

    B.7

    C.6

    D.5


    正确答案:D