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

题目内容 (请给出正确答案)

14、以下程序的输出结果是 main() { int a[] = {2, 4, 6, 8, 10}, y = 1, x, *p; p = &a[1]; for(x = 0; x < 3; x++) y += *(p + x); printf("%d\n", y); }

A.20

B.18

C.17

D.19


参考答案和解析
(14)emoclew
更多 “14、以下程序的输出结果是 main() { int a[] = {2, 4, 6, 8, 10}, y = 1, x, *p; p = a[1]; for(x = 0; x < 3; x++) y += *(p + x); printf("%d\n", y); }A.20B.18C.17D.19” 相关考题
考题 int y=1, x, *p, a[ ]={2,4,6,8,10}; p=a[1]; for(x=0;x3;x++) y + = * (p + x); printf("%d\n",y); 程序的输出结果y的值是__________ 。

考题 有以下程序:void f(int *x,int *y){ int *t; t=x; x=y ;y=t; *x=*y;}main(){ int a[8]={1,2,3,4,5,6,7,8},i,*p,*q; p=a;q=a[7]; while(pq) { f(p,q);p++;q--} for(i=0;i8;i++)printf("d,",a[i]);}程序运行后的输出结果是( )。A.8,2,3,4,5,6,7,1,B.5,6,7,8,1,2,3,4,C.1,2,3,4,5,6,7,8,D.8,7,6,5,4,3,2,1,

考题 有以下程序: main() {int a[]={2,4,6,8,10),y=0,x,*P; P=&a[1]; for(x=1;x<3;x++)y+=p[x]; printf("%d\n",y); } 程序运行后的输出结果是( )。A.10B.11C.14D.15

考题 下列程序的输出结果是()。 include VOid p(int *x) {printf("%d",++*x); } void main() 下列程序的输出结果是( )。#include<stdio.h>VOid p(int *x){ printf("%d",++*x);}void main(){ int y=3;p(y);}A.3B.4C.2D.5

考题 以下程序的输出结果是 【11】 。int fun(int x,int y,int *p,int *q){ *p=x*y;*q=x/y;}main(){int a,b,c,d;a=4;b=3;fun(a,b,c,d);printf("%d,%d\n",c,d);}

考题 以下程序的输出结果是main(){ int x=1,y=3;printf("%d,",x++);{ int x=0;x+=y*2;printf("%d,%d, ",x,y);}printf("%d,%d\n",x,y);}A.1,6,3,1,3B.1,6,3,6,3C.1,6,3,2,3D.1,7,3,2,3

考题 若有以下程序段:include using namespace std;int main (){ int a[]={1,4,5}; int *p 若有以下程序段: #include <iostream> using namespace std; int main () { int a[]={1,4,5}; int *p=a[0],x=6, y,z; for (y=0; y<3; y++) z= ( (* (p+y) <x) ? *(p+y) :x); cout<<z<<end1; return 0; } 程序运行后的输出结果是( )。A.1B.4C.5D.2

考题 下列程序的输出结果是()。includevoid p(int *x){printf("%d",++*x);}void main(){int 下列程序的输出结果是( )。 #include<stdio.h> void p(int *x) { printf("%d",++*x); } void main() { int y=3; p(y); }A.3B.4C.2D.5

考题 执行以下程序后,y的值是 ( ) main( ) { int a[]={2,4,6,8,10}; int y=1,x,*p; p=&a[1]; for(x=0;x<3;x+ +) y+=* (p+x); printf("%d\n",y); }A.17B.18C.19D.20

考题 有以下程序:include main() {int a[] = {2,4,6,8,10} ,y =0,x, * p;p =a[1];for( 有以下程序: #include <stdio.h> main() { int a[] = {2,4,6,8,10} ,y =0,x, * p; p =a[1]; for(x=1;x<3;x++)y+ =p[x]; printf( "% d \n" , y); }程序运行后的输出结果是( )。A.10B.11C.14D.15

考题 以下程序的输出结果是______。 struct HAR {int x,y;struct HAR *p;}h[2] main() { h[0].x=1;h[0].y=2 h[1].x=3;h[1].y=4 h[0].p=h[1];h[1].p=h printf("%d%d\n",()h[0].p)->x,(h[1].p->y); }A.12B.23C.14D.32

考题 以下程序的输出结果是______。 structHAR {int x,y;structHAR*p;}; main() { h[0].x=1;h [0].y=2; h[1].x=3;h[1].y=4; h[0].p=h[1].p=h; printf("%d%d\n",(h[0].p->y)); }A.12B.23C.14D.32

考题 有如下程序void f(int *x,int *y){ int t; t=*x;*x=*y;*y=t;}main(){ int a[6]={1,2,4,6,8,10},i,*p,*q; p=a;q=a[5]; while(pq) { f(p,q); p++; q--; } for(i=0;i6;i++) printf("%d,",a[i]);}该程序的输出结果是A.1,2,4,6,8,10 B.10,8,4,6,2,1C.10,8,6,4,2,1 D.10,2,4,6,8,1

考题 有以下程序 main() { iht a[]{2,4,6,9,10}, y=0,x,*p; p=a[1]; for(x=1);X<3;x++) y+=p[x]; printf("%d\n",y); 程序运行后的输出结果是A.10B.11C.14D.15

考题 下列程序的输出结果是______。main() { int x,y; for(x=1,y=1;x=5)break;if(y%3= 下列程序的输出结果是______。 main() { int x,y; for(x=1,y=1;x<=10;x++) {if(y>=5)break; if(y%3==1) }y+=3; continue; } y-=5; } printf("%d\n",x); }A.2B.3C.4D.5

考题 分析下面的程序 main() { int*p1,*p2,*p; int x=4,y=6; p1=x;p2=y; if(x<y) {p=p1;p1=p2;p2=p; } printf("%d,%d,",*p1,*p2); printf("%d,%d\n",x,y); } 程序的输出结果为_______。A.6,4,4,6B.4,6,6,4C.4,6,4,6D.6,4,6,4

考题 有以下程序 void f(int *x,int *y) { int t; t=*X; *X=*y; *y=t; } main() { int a[8]={1,2,3,4,5,6,7,8},i,*p,*q; p=a; q=a[7); while(p>q) { f(p,q); p++; q--; } for(i=0; i<8; i++) printf("%d,",a[i]); } 程序运行后的输出结果是A.8,2,3,4,5,6,7,1,B.5,6,7,8,1,2,3,4,C.1,2,3,4,5,6,7,8,D.8,7,6,5,4,3,2,1,

考题 以下程序的输出结果是 ______。 struct HAR {int x,y;struct HAR*p;}h[2]; main() { h[0],x=1;h[0].y=2; h[1]x=3;h[1].y=4; h[0].p、h[1];h[1]..p=h; printf("%d%d\n",(h[0].p)->x,(h[1].p)->y; }A.12B.23C.14D.32

考题 下面程序的输出结果是main{ int x=3 ,y=6,a=0; while(x++!=(y-=1) ) { a+=1; if (yx) break; } printf("x=%d,y=%d,a=%d\n",x,y,a);}A.x=4,y=4,a=1 B.x=5,y=5,a=1 C.x=5,y=4,a=1 D.x=5,y=4,a=3

考题 若有以下程序段;includeusing namespace std;int main(){ int a[]={1,4,5}; int *p=a[0],x=6,y,z; for(y=0;y<3;y++) z=((*(p+y)<x) ? *(p+y):x); cout<<z<<end1; return 0; } 程序运行后的输出结果是( )。A.1B.4C.5D.2

考题 以下程序的输出结果是______。 struct HAR {int x,y;struct HAR*p;}h[2]; main() { h[0].x=1;h[0].y=2; h[1].x=3;h[1].y=4; h[0].p=h[1];h[1].p->y); printf("%d%d\n",(h[0].p)->x,(h[1].p)->y); }A.12B.23C.14D.32

考题 执行以下程序后,y的值是 ( ) main( ) { int a [ ]={2,4,6,8,10); int y=1,x, *p; p=a[1]; for(x=0;x<3; x + +) y + =* (p + x); printf("%d\n",y); }A.17B.18C.19D.20

考题 有以下程序:main{ int a[]=(2,4,6,8,10},y=0,x,*P;p=&a[1];for(x=1;x3;x++) y+=p[x];printf(%d\n,y);}程序运行后的输出结果是( )。A.A.10B.11C.14D.15

考题 下列程序的输出结果为______。 main ( ) { int p, y=0, x=0; p=x>8; printf("%d",p); p+ 下列程序的输出结果为______。 main ( ) { int p, y=0, x=0; p=x<<8 | ~y>>8; printf("%d ",p); p+=(p+=2); printf("%d\n",p); }A.-1 0B.0 0C.0 4D.-1 2

考题 有以下程序:include void f(int * x,int * y) int t;t= *x; *x= *y; *y=t;main ( ){in 有以下程序:#include <stdio.h>void f(int * x,int * y) int t; t= *x; *x= *y; *y=t;main ( ){ int a[8] = { 1,2,3,4,5,6,7,8} ,i, * p, * q; p=a;q =a[7]; while(p<q) { f(p,q) ;p ++ ;q --; } for(i =0;i<8;i ++ ) printf(" % d," ,a[i]); }程序运行后的输出结果是( )。A.8,2,3,4.,5,6,7,1,B.5,6,7,8,1,2,3,4,C.1,2,3,4,5,6,7,8,D.8,7,6,5,4,3,2,1,

考题 执行以下程序后,y的值是() main( ) { int a[]={2,4,6,8,10}; int y=1,x,*p; p=a[1]; for(x=0;x3;x++) y + = * (p + x); printf(""%d/n"",y); }A、17B、18C、19D、20

考题 单选题执行以下程序后,y的值是() main( ) { int a[]={2,4,6,8,10}; int y=1,x,*p; p=a[1]; for(x=0;x3;x++) y + = * (p + x); printf(""%d/n"",y); }A 17B 18C 19D 20

考题 单选题有以下程序 #include main() {  inta[]={2,4,6,8,10},x,*p,y=1;  p=a[1];  for(x=0;x3;x++)y+=*(p+x);  printf("%d",y); } 程序的输出结果是(  )。A 19B 13C 11D 15