网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
以下程序段的输出结果为(). char c[]="abc"; int i=0; do while(c[i++]!=’/0’);printf("%d",i-1);
- A、abc
- B、ab
- C、2
- D、3
参考答案
更多 “以下程序段的输出结果为(). char c[]="abc"; int i=0; do while(c[i++]!=’/0’);printf("%d",i-1);A、abcB、abC、2D、3” 相关考题
考题
若变量已正确定义,有以下程序段i=0;do printf("%d,",i);while(i++);printf("%d\n",i)其输出结果是A ) 0 , 0B ) 0 , 1C ) 1 , 1D ) 程序进入无限循环
考题
有以下程序#include stdio.hmain(){ char *a[]={"abcd","ef","gh","ijk"};int i;for(i=0;i4;i++) printf("%c",*a[i]);}程序运行后的输出结果是A)aegiB)dfhkC) abc dD)abcdefghijk
考题
以下程序运行后的输出结果是【】。main(){int i,n[]={0,0,0,0,0}; for(i=1;i=4;i++) { n[i]=n[i-1]*2+1; printf("%d",n[i]); }}
考题
以下程序运行后的输出结果是【9】。includestdio.hmain(){ int i,n[]={0,0,0,0,0};for(i=1;i=2;i++){ n[i]=n[i-1]*3+1;printf("%d",n[i]);}printf("\n");}
考题
以下程序运行后的输出结果是【】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);}
考题
若输入12345、abc,程序的输出结果为______。 main() { int a; char ch; scanf("%3d,%3c",a,ch); printf("%d,%c",a,ch); }A.123,abcB.123,4C.123,aD.12345,abc
考题
以下C程序段的输出结果是(30)。 include void abc(char *str){ int a, b;
以下C程序段的输出结果是(30)。 #include <stdio. h> void abc(char *str){ int a, b; for(a=b=0;str[a]!='\O';a++)if(str[a]!='c') str[b++]=str[a]; str[b]='\O'; } void main(){ char str[]="abcdef"; abc(str); printf("str[]=%s",str); }A.str[]=aB.str[]=abC.str[]=abdefD.str[]=abcdef
考题
下列程序的运行结果为()。includevoid abc(char*str){int a,b,i,j; for(i=j=0;str[i]!=
下列程序的运行结果为( )。 #include<stdio.h> void abc(char*str) { int a,b,i,j; for(i=j=0;str[i]!='\0';i++) if(str[i]!='a' str[j++]=str[i]; str[j]='\0'; } void main() { char str[]="abcdef"; abc(str); printf("str[]=%s",str); }A.str[]=bcdefB.str[]=abcdefC.str[]=aD.str[]=ab
考题
以下程序的输出结果是( )。 main() {char *p[]={"ABC","DEF","GHI","JKL"}; int i; for(i=3;i>=0;i--,i--) printf("%c",*p[i]);}
考题
以下程序的输出结果为()。includemain(){ char *alpha[6]={"ABCDEFGH","IJKL","MNOP","
以下程序的输出结果为( )。 #include<stdio.h> main() { char *alpha[6]={"ABCDEFGH","IJKL","MNOP","QRST","UVWX"}; char**p;int i; p=alpha; for(i=0;i<4;i++)printf(" %s" ,p[i]);printf("\n" );}A.ABCDEFGHIJKLB.ABCDC.ABCDEFGHIJKLMNOPQRSTD.AEIM
考题
有以下程序:includevoid f(char p[][10],int n){char t[10];int i,j;for(i=0;i
有以下程序: #include<string.h> void f(char p[][10],int n) {char t[10];int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(strcmp(p[i],p[j])>0) {strcpy(t,p[i]);strcpy(p[i],p[j]);strcpy(p[j],t);} } main() {char p[5][10]={"abc","aabdfg","abbd","dedbe","cd"}; f(p,5); printf("%d\n",strlen(p[0]));} 程序运行后的输出结果是( )。A.2B.4C.6D.3
考题
以下程序运行后输入:3,abcde回车,则输出结果是【 】include move(char *str,
以下程序运行后输入:3,abcde回车,则输出结果是【 】include <string.h>move(char *str, int n){ char temp; int i;temp=str[n-1];for(i=n-1;i>0;i--) str[i]=str[i-1];str[0]=temp;}main( ){ char s[50]; int n, i, z;scanf("%d,%s",n,s);z=strlen(s);for(i=1; i<=n; i++) move(s, z);printf("%s\n",s);}
考题
有以下程序includestdio.hmain( ){int i,n[]=(0,0,0,0,0);for(i=1;i=4;i++){n[i]=n[i-1]*3+1;printf(”%d”,n[i]));}}程序运行后的输出结果是______。
考题
以下程序运行后的输出结果是( )。 include main() {char ch[]="abcd",x[4][4];int i; f
以下程序运行后的输出结果是( )。 include<string.h> main() {char ch[]="abcd",x[4][4];int i; for(i=0;i<4;i++)strcpy(x[i],ch); for(i=0;i<4;i++)printf("%s",x[i][i]); printf("\n"); }
考题
以下程序的功能是输出a数组中所有字符串,请填空。#include stdio.hmain( ){ char *a[ ]={”ABC”,”DEFGH”,”IJ”,”KLMNOP”};int i=0;for(;i4; i++) printf(”%s\n【 13 】 );}
考题
以下程序段的输出结果是()。includemain(){char p[][4]={"ABC","DEF","GHI"};int i;for
以下程序段的输出结果是( )。 #include<stdio.h> main() {char p[][4]={"ABC","DEF","GHI"}; int i; for(i=0;i<3;i++) puts(p[i]); }A.A B CB.A D GC.A B C D E F G H ID.A B C
考题
有以下程序includevoid main(){char s[]={"01aXy"};int i,n=0;for(i=0;s[i]!=0;i++)if
有以下程序 #include<stdio.h> void main() { char s[]={"01aXy"};int i,n=0; for(i=0;s[i]!=0;i++) if(s[i]<='a's[i]>='z')n++; printf("%d\n",n); } 程序运行后的输出结果是( )。A.0B.2C.3D.5
考题
以下程序运行后的输出结果是______。 main () { int y=18,i=0,j,a[8]; do { a[i]=y%2;i++; y=y/2; } while(y>=1); for(j=i-1;j>=0;j--)printf("%d",a[j]); printf("\n"); }A.1000B.10010C.110D.10100
考题
以下程序运行后,输出结果是( )。 main() {int y=18,i=0,j,a[8]; do { a[i]’y%2; i++; y=y/2; } while(y>=1); for(j=i-1;j>=0;j--) printf("%d",a[j]); printf("\n"); }A.1000B.10010C.110D.10100
考题
有以下程序(注:字符a的ASCII码值为97)#includestdio.hmain(){ char*S={"abc"}:do{printf("%d",*s%10);++s;}while(*s);}程序运行后的输出结果是A.abcB.789C.7890D.979899
考题
有以下程序 main() { int i=0,s=0; do{ if(i%2){i++;continue;} i++; s+=i; }while(i<7); printf("%d\n",s); } 执行后输出结果是A.16B.12C.28D.21
考题
有以下程序 main () { int i=0,s=0; do{ if(i%2) {i++;continue; } i++; s+=i; while (i<7); printf ( "%d\n" , s ); } 执行后输出的结果是A.16B.12C.28D.21
考题
当运行以下程序时,输入abcd,程序的输出结果是:( )。insert(char str[]){int i;i=strlen(str);while(i>0){str[2*i]=str[i];str[2*i-1]='*';i--;}printf("%s\n",str);}main(){char str[40];scanf("%s",str);insert(str);}
考题
试题9以下程序运行后的输出结果是_____.#include stdio.hmain(){ int i, n[]={0,0,0,0,0};for(i=1; i=2; i++){ n[i]=n[i-1]*3+1;printf(“%d”, n[i]);}printf(“\n”);}
考题
以下程序的输出结果为( )。main( ){ char s1[40]="country",s2[20]="side";int i=0,j=0;while(s1[i]!='\0') i++;while(s2[j]!='\0') s1[i++]=s2[j++];s1[i]=0;printf("%s\n",s1);}A sideB countryC sidetryD countryside
考题
char a[10];不能将字符串"abc"存储在数组中的是( ).A、strcpy(a,"abc");B、a[0]=0;strcat(a,"abc");C、a="abc";D、int i;for(i=0;i<3;i++)a[i]=i+97;a[i]=0;
考题
单选题有以下程序:#include main(){ int i,j=0; char a[] = How are you!,b[10]={0}; for(i=0;a[i];i++) if(a[i]==' ') b[j++]=a[i-1]; printf(%s,b);}程序运行后的输出结果是( )。A
weB
How are you!C
ayD
we!
热门标签
最新试卷