[单选题]

有以下程序

#include

main()

{ char str[][20]={"Hello","Beijing"},*p=str;

printf("%d/n",strlen(p+20));

}

程序运行后的输出结果是

A.0

B.5

C.7

D.20

参考答案与解析:

相关试题

有以下程序#include "stdio.h"main(){ char str[

[单选题]有以下程序#include "stdio.h"main() { char str[]="tomeetme",str1[]="toseeyou"; char *p=str,*p1=str1; int i; for(i=0;i if(*(p+i)==*(p1+i)) putchar(*(p+i)); printf("\n");}程序的运行结果是A.to B.tomeetC.toeeD.程序段不能通过编译

  • 查看答案
  • 有以下程序#include <stdio.h>main(){ char a[20

    [试题]有以下程序#include <stdio.h>main(){ char a[20]="How are you?",b[20];scanf("%s",b); printf("%s %s/n",a,b);}程序运行时从键盘输入: How are you?< 回车 >则输出结果为 ( 1 3 ) 。

  • 查看答案
  • 有以下程序main(){ char str[]="xyz",*ps=str; w

    [单选题]有以下程序main(){ char str[]="xyz",*ps=str; while(*ps) ps++; for(ps--; ps-str>=0; ps--) puts(ps);} 程序的运行结果是A.yz B.z C.z D.x xyz yz yz xy xyz xyz

  • 查看答案
  • 有以下程序:main(){char str[]="xyz", *ps=str;w

    [单选题]有以下程序: main() { char str[]="xyz", *ps=str; while(*ps) ps++; for(ps--;ps-str>=O;ps--) puts(ps); } 执行后的输出结果是( )。A.yz xyzB.z yzC.z yz xyzD.x xy xyz

  • 查看答案
  • 有以下程序:#include main( ) char * p[ ] = {"

    [单选题]有以下程序:include main( ) char * p[ ] = {"3697" ,"2548" }; int i,j;long num =0有以下程序: #include <stdio.h> main( ) char * p[ ] = {"3697" ,"2548" }; int i,j; long num =0; for(i =0;i<2;i ++ ) { j =0; while(p[i][j]! ='/0') { if((p[i][j]-'0')%2) nu

  • 查看答案
  • 有以下程序:include<stdio.h>main( ){ char a[20

    [单选题]有以下程序:include<stdio.h>main( ){ char a[20],b[20],c[20];scanf("%s%s",a,b);gets(c);printf("%S%S%s/n",a,b,c);}程序运行时从第一列开始输入:This is a cat!<回车>则输出结果是( )。A.Thisisacat!B.Thisis aC.Thisis a cat!D.Thisisa cat !

  • 查看答案
  • 有以下程序: #include #include main( ) {char

    [单选题]有以下程序: include include main( ) {char p[] = {'a','b','c'] ,q[10有以下程序: #include <stdio.h> #include <string.h> main( ) { char p[] = {'a','b','c'] ,q[10] = {'a','h','c'} prinff( "% d % d/n" , strlen (p) , strlen (q) );以下叙述中正确的是( )。A

  • 查看答案
  • 以下程序:#include#includemain(){char str[]="

    [单选题]以下程序:includeincludemain(){char str[]="abcd/n/123/xab";printf("%d"以下程序: #include<stdio.h> #include<string.h> main() {char str[]="abcd/n/123/xab"; printf("%d",(str)); } 运行后的输出结果是( )。A.10B.9C.7D.14

  • 查看答案
  • 有以下程序:include<strintg.h>main{ char p[20]

    [单选题]有以下程序:include<strintg.h>main{ char p[20]={a,b,c,d),q[]="abc",r[]=&quo有以下程序:include<strintg.h>main{ char p[20]={a,b,c,d),q[]="abc",r[]="abcde";strcpy(p+strlen(q),r);strcat(p,q);printf("%d%d\n",sizeof

  • 查看答案
  • 有以下程序: #include main( ) { char *p="abcde

    [单选题]有以下程序: include main( ) { char *p="abcde/0ghjik/0"; printf("%d/n",str有以下程序: #include<string.h> main( ) { char *p="abcde/0ghjik/0"; printf("%d/n",strlen(p) ); } 程序运行后的输出结果是A.12B.15C.6D.5

  • 查看答案
  • 有以下程序#include main(){ char str[][20]={"H