网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
有如下程序: #include  main() {  char *p,old_str[10]=wind;  int password;  scanf(%d,&password);  p = old_str;  while(*p)  {   printf(%c,*p+password);   p++;  }  printf(); } 程序运行时,从键盘输入2<回车>,输出结果是(  )。
A

ykpf

B

wind

C

xjoe

D

2222


参考答案

参考解析
解析:
程序执行过程为:定义字符数组str并且初始化为:"wind",定义password并通过scanf函数从键盘为其赋值2。定义指针p并使其指向字符串。通过while循环,将字符数组中每一个字符的ASCII码加2,并且按字符格式输出每一个字符。程序运行后输出结果是:ykpf。答案选择A选项。
更多 “单选题有如下程序: #include main() {  char*p,old_str[10]=wind;  intpassword;  scanf(%d,password);  p=old_str;  while(*p)  {   printf(%c,*p+password);   p++;  }  printf(); } 程序运行时,从键盘输入2回车,输出结果是(  )。A ykpfB windC xjoeD 2222” 相关考题
考题 有以下程序:void main(){char s[]="159",*p;p=s;printf("%c",*p++);printf("%c",*p++);}程序运行后的输出结果是( )。A.15 B.16 C.12 D.59

考题 有以下程序: main() { char s[]="159",*P; P=s; printf("%c",*P++);printf("%c",*P++); } 程序运行后的输出结果是( )。A.15B.16C.12D.59

考题 有以下程序:includemain(){char *p,*q;p=(char*)malloc(sizeof(char)*20);q=p;scanf( 有以下程序: #include <stdlib.h> main() { char *p,*q; p=(char*)malloc(sizeof(char)*20); q=p; scanf("%s%s",p,q); ptintf("%s%s\n",p,q); } 若从键盘输入abc def<回车>,则输出的结果是( )。A.def defB.abc defC.abc dD.d d

考题 有以下程序: includemain(){char*p,*q; p=(char *)malloc(sizeof(char)* 20);q=p; sca 有以下程序: # include<stdio.h> main() { char*p,*q; p=(char *)malloc(sizeof(char)* 20);q=p; scanf("%s %s",p,q);printf("%s %s\n",p,q); } 若从键盘输入;abc def<回车>,则输出结果是 ______。A.def defB.abc defC.abe dD.d d

考题 下列程序的输出结果是()。includevoid main(){int b[6]={2,4,6,8,10,12};int*p--b,**q= 下列程序的输出结果是( )。 #include<stdio.h> void main() { int b[6]={2,4,6,8,10,12}; int*p--b,**q=p; printf("%d",*(p++)); printf("%d",**q); }A.*p=a;scanf("%1f",p);B.*p=a;scanf("%f",p);C.p=a;scanf("%1f",*p);D.p=a;scanf("%1f",p);

考题 下列程序的输出结果是______。 includef(char 8s){char *p=s;while(*p!='\0')p++;retur 下列程序的输出结果是______。# include<stdio.h>f(char 8s){ char *p=s; while(*p!='\0')p++; return(p-s);}main(){ printf("%d\n",f("ABCDEF"));}A.3B.6C.8D.0

考题 以下程序运行后的输出结果是【】include main ( ) {char a[] ="123456789", *p;int i =0; 以下程序运行后的输出结果是【 】include <stdio.h>main ( ){ char a[] ="123456789", *p;int i =0;p=a;while( * p){ if(i%2 ==0) *p='*';p++;i++;}puts(a);}

考题 以下程序运行后的输出结果是( )。includechar*ss(char*s){char*p,t;P=s+1;t=*s;while(*p){ *(P-1)=*P;P++;}*(P-1)=t;return s;}main(){char*p,str[10]="abcdefgh";p=ss(str);printf("%s\n",p);}

考题 有以下程序 main() { char s[]="159",*p; p=s; printf("%c",*p++); pritnf("%c",*p++); } 程序运行后的输出结果是A.15B.16C.12D.59

考题 有以下程序: include main( ) {char s[ ] ="159" , * p;p=s;printf( "% c", * p + + 有以下程序: #include <stdio.h> main( ) { char s[ ] ="159" , * p; p=s; printf( "% c", * p + + ); printf("%~", * p++);}程序运行后的输出结果是( )。A.15B.16C.12D.59

考题 下面程序段的输出结果是( )。 char a[]="lanuage",*p; p=a; while(*P! ='u') {printf("%c",*p-32); P++;}A.LANGUAGEB.languageC.LAND.langUAGE

考题 有以下程序includemain(){ char*p,*q;p=(char *)malloc(sizeof(char)*20);q=p;scanf( 有以下程序 #include<stdlib.h> main() { char*p,*q; p=(char *)malloc(sizeof(char)*20);q=p; scanf(“%s%s”,p,q);printf(“%s%s\n”,p,q); } 若从键盘输入:abc def<回车>,则输出结果是A.def defB.abc defC.abc dD.d d

考题 有以下程序include main(){ char *p,*q;p=(char*)malloc(sizeof(char)*20);q=p;scanf 有以下程序 #include <stdlib.h> main() { char *p,*q; p=(char*)malloc(sizeof(char)*20); q=p; scanf("%s %s",p,q); printf("%s %s\n",p,q); } 若从键盘输入:abc def<回车>, 则输出结果是A.def defB.abc delC.abc dD.d d

考题 下列程序舶输出结果是【 】。include main() {int a[5]={2,4,6,8,10},*p;p=a;p++;printf(" 下列程序舶输出结果是【 】。include <stdio.h>main(){int a[5]={2,4,6,8,10},*p;p=a;p++;printf("%d",*p);}

考题 请读程序: 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

考题 若有如下程序: f2(char*t){*t=*t-32; return(*t);}fl(char*p){for(;*p!='\0';p++) if(*p>='a'*p<='z')f2(p); } main() {char a[10]="abcbgH"; f1(a); printf("%S",a); } 则程序运行后的输出结果是( )。A.ABCBGHB.abcdefghC.abcdgD.EFH

考题 有以下程序include.main(){char*p="abcde\ofghjik\0";printf("%d\n",strlen(p));} 程 有以下程序 #include.<string.h> main() { char *p="abcde\ofghjik\0"; printf("%d\n",strlen(p)); } 程序运行后的输出结果是A.12B.15C.6D.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.8B.7C.6D.5

考题 有以下程序: include main( ) { char *p ,* q; p=(char * )malloc(sizeof(char 有以下程序: #include<stdlib.h> main( ) { char *p ,* q; p=(char * )malloc(sizeof(char) * 20);q=p; scanf("%s%s",p,q); printf("%s%s\n",p,q); } 若从键盘输入:abc def<回车>,则输出结果是A.def defB.abc defC.abc dD.d d

考题 设有如下函数定义,则输出结果为_______。 char*fun(char*str) { char*p=str; while(*p) {if(*p>'d')continue; p++; } return p; } main() { printf("%s\n",fun("welcome!")); }A.welcomeB.come!C.wD.程序进入死循环

考题 若有如下程序: void a(char*p,char c) {while(*p) { if(*p==c)*p=c-'b'+'B';; p++; } } main() {char s[50]="abcdeeffgee",b='e'; a(s,b);printf("%s\n",s); } 则程序运行后的输出结果是( )。A.AbcdeeffgeeB.ABCDeeFFGeeC.abcdEEffgEED.ABCDEEFFGEE

考题 单选题有以下程序#include void fun1(char *p){  char *q;  q=p;  while(*q!='\0') {   (*q)++;   q++; } }main(){ char a[]={Program},*p;  p=a[3];  fun1(p);  printf(%s,a); }程序执行后的输出结果是(  )。A ProhsbnB PrphsbnC ProgsbnD Program

考题 单选题有以下程序#include main (){ int a[5] = {2,4,6,8,10},*p,**k; p = a; k = p; printf(%d,*(p++)); printf(%d,**k);}程序运行后的输出结果是(  )。A 24B 44C 22D 46

考题 单选题有以下程序:#include main(){ int password; char *p,old_str[10]=wind; scanf(%d,password); p = old_str; while(*p) {  printf(#%c,*p+password);  p++; }}程序运行时,从键盘输入2回车,输出结果是(  )。A #y#k#p#fB #wi#nd#C xj#oeD #2222#

考题 单选题有以下程序:#include #include char *a=you;char *b=Welcome you to Beijing!;main(){ char *p; p=b; while(*p != *a)p++; p+=strlen(a)+1; printf(%s,p);}程序运行后的输出结果是(  )。A Beijing!B you to Beijing!C Welcome you to Beijing!D to Beijing!

考题 单选题有以下程序 #include charfun(char*c) {  if(*c='Z'*c='A')   *c-='A'-'a';  return*c; } main() {  chars[81],*p=s;  gets(s);  while(*p)  {   *p=fun(p);   putchar(*p);   p++;  }  printf(); } 若运行时从键盘上输入OPENTHEDOOR回车,程序的输出结果是(  )。A OPEN THE DOORB OPEN tHE dOORC open the doorD Open The Door

考题 单选题有以下程序: #include intfun(char*s) {  char*p=s;  while(*p++!='\0');  return(p-s); } main() {  char*p=01234;  printf(%d,fun(p)); } 程序的运行结果是(  )。A 6B 5C 4D 3