第三题:下列4个选项中,哪个结果为6?
int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, *p = a;
(A) *p + 6; (B) *(p+6); (C) *p += 5; (D) p+5;
第1题:
有以下程序 #include<stdio.h> main() { int a[]={1,2,3,4,5,6,7,8,9,10,11,12,},*p=a+5,*q=NULL; *q= *(p+5); printf("%d %d\n",*p,*q); } 程序运行后的输出结果是
A.运行后报错
B.6 6
C.6 11
D.5 10
第2题:
有以下程序: #include <stdio.h> main() { int a[]={1,2,3,4,5,6,7,8,9,10,11,12,},*p=a+5,*q=NULL; *q=*(p+5); printf("%d %d \n",*p,*q); } 程序运行后的输出结果是( )。
A.运行后报错
B.66
C.611
D.510
第3题:
若有以下说明: int a[10]={1,2,3,4,5,6,7,8,9,10},*p=a; 则值为6的表达式是_______。
A.*p+6
B.*(p+6)
C.*p+=5
D.p+5
第4题:
以下程序的输出结果是 ______。 #define NULL 0 #include<iostream.h> void main(){ int a[]={1,2,3,4,5,6,7,8,9,10}; int *p=a+5,*q=NULL; *q=*(p+5); cout<<*p<<’ ’<*q; }
A.运行后报错
B.6 6
C.6 11
D.5 5
第5题:
有以下程序main() { int a[]={1,2,3,4,5,6,7,8,9,0},*p; for(p=a;p<a+10;p++) printf("%d,",*p);}程序运行后的输出结果是A.1,2,3,4,5,6,7,8,9,0, B.2,3,4,5,6,7,8,9,10,1, C.0,1,2,3,4,5,6,7,8,9, D.1,1,1,1,1,1,1,1,1,1,
第6题:
有以下程序: main() { int a[]={1,2,3,4,5,6,7,8,9,0},*p; for(p=a;p<a+10,p++)printf("%d,",*p); } 程序运行后的输出结果是 ______。
A.1,2,3,4,5,6,7,8,9,0,
B.2,3,4,5,6,7,8,9,10,1,
C.0,1,2,3,4,5,6,7,8,9,
D.1,1,1,1,1,1,1,1,1,1,
第7题:
有以下程序:#include <stdio. h>main( ){ int a[ ] = { 1,2,3,4,5,6,7,8,9,0} , * p; for(p =a;p<a+10;p++) printf("%d," , *p); }程序运行后的输出结果是( )。
A.1,2,3,4,5,6,7,8,9,0,
B.2,3,4,5,6,7,8,9,10,1,
C.0,1,2,3,4,5,6,7,8,9,
D.1,1,1,1,1,1,1,1,1,1,
第8题:
以下程序的运行结果是______。 #include <stdio.h> 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); }
A.运行后报错
B.66
C.612
D.5 5
第9题:
有以下程序 # include <stdio.h> main() { int a[]={1,2,3,4,5,6,7,8,9,10,11,12,},*p=a+5,*q=NULL; *q=*(p+5); printf("%d %d \n",*p,*q); } 程序运行后的输出结果是
A.运行后报错
B.6 6
C.6 11
D.5 10
第10题:
若有以下说明:int [10]={1,2,3.4,5,6,7,8,9,10},*p= a;则数值为6的表达式是()
第11题:
1,2,3,4,5,6,7,8,9,10,
10,9,8,7,6,5,4,3,2,1,
2,3,1,6,8,7,5,4,10,9,
10,9,8,7,6,1,2,3,4,5,
第12题:
printf(%d,*p[5]);
printf(%d,p[5]);
printf(%d,*(p+5));
printf(%d,*(a+5));
第13题:
有以下程序 struct S{ int n;int a[20];}; voidf(struct S*p) { int i,j,t; for(i=0;i<p->n-1;i++) for(j=i+1;j<p->n;j++) if(p->a[i]>p->a[j]){t=p->a[i];p->a[i]=p->a[j];p->a[j]=t;} } main() { int i;struct S s={10,{2,3,l,6,8,7,5,4,10,9}}; f(&s); for(i=0;i<s.n;i++)printf("%d,",s.a[i]); } 程序运行后的输出结果是
A.1,2,3,4,5,6,7,8,9,10,
B.10,9,8,7,6,5,4,3,2,1,
C.2,3,1,6,8,7,5,4,10,9,
D.10,9,8,7,6,1,2,3,4,5,
第14题:
下面程序的输出结果是( )。 #include<stdio.h> main() {int a[]={1,2,3,4,5,6,7,8,7,10},*p; p=a; printf("%d\n",*p+8); }
A.0
B.1
C.10
D.9
第15题:
以下程序的运行结果是_______。 #include "stdio.h" 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); }
A.运行后报错
B.6 6
C.6 12
D.5 5
第16题:
下面程序的输出结果是 #include<stdio.h> main() { int a[]={1,2,3,4,5,6,7,8,9,0},*p; p=a; printf("%d\n",*p+9);}
A.0
B.1
C.10
D.9
第17题:
以下程序的输出结果是 #include<stdio.h> int a[3][3]={1,2,3,4,5,6,7,8,9,},*p; main() { p=(int*)malloc(sizeof(int)); f(p,a); printf("%d\n",*p); free(p);} f(int *s, int p[][3]) { *s=p[1][1];}
A.1
B.4
C.7
D.5
第18题:
第二题:下列哪个引用是不正确的?
int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, *p = a;
(A) a[p-a]; (B) *(&a); (c) p; (D) *(*(a+i));
第19题:
有以下程序: #include<iostream> using namespace std; int main () { int a[]={1,2,3, 4,5, 6, 7,8,9, 10, 11, 12}; int *p=a+5, *q=0; *q=* (p+5); cout<<*p<<" "<<*q<<end1; return 0; }
A.运行后报错
B.66
C.6 12
D.5 5
第20题:
以下程序的运行结果是( )。 #include <stdio.h> main() { int a[]={1,2,3,4,5,6,7,8,9,10,11,12}; int *p=a+5,*q=NULL; *q=8(p+5); printf("%d %d\n", *p,*q); }
A.运行后报错
B.6 6
C.6 11
D.5 5
第21题:
下面程序的输出结果是______。 main() {int a[10]={0,1,2,3,4,5,6,7,8,9},*p=a+4; printf("%d\n",p[3]); }
A.6
B.7
C.3
D.5
第22题:
若有int a[10]={0,1,2,3,4,5,6,7,8,9},*p=a;则输出结果不为5 的语句为()。
第23题:
p+6
*(p+6)
p+=5
p+5