以下程序的输出结果是_______________ void main( ) { int k;char a[ ]=”language”,b[ ]=”program”; char *p=a,*q=b; for(k=0;k<=5;k++) if(*(p+k)==*(q+k)) printf("%c",*(q+k)); }
举一反三
- 以下程序的运行结果是#include<stdio.h>void main(){static char a[]="Language",b[]="programe";char *p,*q;int k;p=a;q=b;for(k=0;k<=7;k++)if(*(p+k)==*(q+k))printf("%c",*(p+k));}
- 以下程序运行结果为#include[stdio.h] void main() { char a[] = "Language", b[] = "programe"; char *p, *q; int k; p = a; q = b; for (k=0; k<8; k++) if (*(p+k) == *(q+k)) printf("%c", *(p+k)); } A: gae B: ga C: Language D: programe
- 10. 以下程序的输出结果是____________. void main() { char w[][10]={"ABCD","EFGH","IJKL","MNOP"},k; for(k=1;k<3;k++) printf("%s ",w[k]); }
- 下面程序的运行结果是____ #include [stdio.h] #include [string.h] main() { int a[3][3]={{2},{4},{6}}; int k,*q=&a[0][0]; for(k=0;k<2;k++) { if(k= =0) a[k][k+1]=*q+1; else ++q; printf(“%d”,*q); } A: 26 B: 23 C: 36 D: 33
- 中国大学MOOC: 下面程序段执行后的输出结果是( )。int a[]={2,4,6,8,10,12,14,16,18,20,22,24},*q[4],k;for (k=0; k<4; k++) q[k]=&a[k*3];printf("%d",q[3][0]);