题目内容

有以下程序,执行后输出结果是()。#include #include int main(){char *p[10]={"abc","aabdfg","dcdbe","abbd","cd"};printf("%d\n",strlen(p[4]));return 0;}

A. 2
B. 3
C. 4
D. 5

查看答案
更多问题

有以下程序,执行后输出结果是()。#include int a=2;int f(int *a){return (*a)++;}int main(){int s=0;{int a=5;s+=f(&a);printf("%d\n",a);}s+=f(&a);printf("%d\n",a);printf("%d\n",s);return 0;}

A. 10
B. 9
C. 7
D. 8

若有定义:int a,b,*p,*q;p=&a;q=&b;q=p;a=30*3;b=60-20;printf("%d",*q);那么输出的结果是:

A. 30
B. 40
C. 60
D. 90

以下程序的运行结果是()。#include int main(){int a[]={1,2,3,4,5,6,7,8,9,10,11,12};int *p=a+5,*q=NULL;*q=*(p+5);printf("%d %d\n",*p,*q);return 0;}

A. 运行后报错
B. 6 6
C. 6 12
D. 5 5

以下程序的输出结果是()。#include int main(){char *alpha[6]={"ABCD","EFGH","IJKL","MNOP","QRST","UVWX"};char **p;int i;p=alpha;for(i=0;i<4;i++)printf("%s",p[i]);printf("\n");return 0;}

ABCDEFGHIJKL
B. ABCD
C. ABCDEFGHIJKLMNOP
D. AEIM

答案查题题库