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

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

有以下程序片段 int a[ ]={1,2,3,4},y,*p=&a[3]; --p; y=*p; printf("y=%dn",y); 程序的运行结果是

A.y=0

B.y=1

C.y=2

D.y=3


参考答案和解析
C
更多 “有以下程序片段 int a[ ]={1,2,3,4},y,*p=a[3]; --p; y=*p; printf("y=%dn",y); 程序的运行结果是A.y=0B.y=1C.y=2D.y=3” 相关考题
考题 有以下程序#include stdio.hmain( ){ int a[ ]={1,2,3,4},y,*p=a[3];--p; y=*p; printf("y=%d\n",y);}程序的运行结果是A)y=0B)y=1C)y=2D)y=3

考题 有以下程序#include stdio.hstruct ord{ int x,y; } dt[2]={1,2,3,4};main(){ struct ord *p=dt;printf("%d,",++p-x); printf("%d\n",++p-y);}程序的运行结果是A)1,2B)2,3C)3,4D)4,1

考题 (26)有以下程序#include stdio.hvoid fun( int *a,int *b){int *c;c=a;a=b;b=c;}main(){int x=3,y-5,*P=x,*q=y;fun(p,q);printf(“%d,%d,”,*p,*q);fun(x,y);printf(“%d,%d\n”,*p,*q);}程序运行后的输出结果是A)3,5,5,3 B)3,5,3,5 C)5,3,3,5 D)5,3,5,3

考题 有以下程序includemain(){inta[]={1,2,3,4},y,*p=a[3];--p;y=*p;printf("y=%d\n" 有以下程序 #include <stdio.h> main() { int a[]={1,2,3,4},y,*p=a[3]; --p; y=*p;printf("y=%d\n",y); } 程序的运行结果是A.y=0B.y=1C.y=2D.y=3

考题 (37)有以下程序#include stdio.hstruct ord{ int x,y;} dt[2]={1,2,3,4};main(){ struct ord *p=dt;printf (“%d,”,++p-x); printf(“%d\n”,++p-y);}程序的运行结果是A)1,2 B)2,3 C)3,4 D)4,1

考题 有下列程序: include main() {int a[]={1,2,3,4},y,*p=a[3]; -- 有下列程序: #include <stdio.h> main() {int a[]={1,2,3,4},y,*p=a[3]; --p; y=*p; printf("y=%d\n",y); } 程序的运行结果是( )。A.y=0B.y=1C.y=2D.y=3

考题 有以下程序: 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

考题 以下程序的输出结果是 【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);}

考题 若有以下程序段: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

考题 有下列程序: #includestdi0.h structord {intx,y;}dt[2]={1,2,3,4}; voidmain( ) {structord*p=dt; printf("%d,",++P-x);printf("%d,",++P -y); } 程序的运行结果是( ).A.1,2B.2,3C.3,4D.4,1

考题 有以下程序: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

考题 有以下程序: int *f(int *x,int *y) {if(*x<*y)return x; else return y; } main() { int a=7,b=8,*p,*q,*r; p=a; q=b; r=f(p,q); printf("%d,%d,%d\n",*p,*q,*r); } 程序运行后输出结果是______。A.7,8,8B.7,8,7C.8,7,7D.8,7,8

考题 有以下程序 include void fun(int*a,int*B) { int*c; c=a;a=b;b=c; } main() {int x=3 有以下程序 #include<stdio.h> void fun(int*a,int*B) { int*c; c=a;a=b;b=c; } main() { int x=3, y=5,*p=x, *q=y; fun(p,q); printf("%d,%d,",*p,*q); fun(x,y); printf(" %d,%d\n",*p,*q); } 程序运行后的输出结果是______。A.3,5,5,3B.3,5,3,5C.5,3,3,5D.5,3,5,3

考题 有以下程序includestruct ord{ int x,y;} dt[2]={1,2,3,4};mare(){struct ord*p=dt; p 有以下程序 #include<stdio.h> struct ord { int x,y;} dt[2]={1,2,3,4}; mare() { struct ord*p=dt; printf("%d,",++p->x); printf("%d\n",++p->y); } 程序的运行结果是______。A.1,2B.2,3C.3,4D.4,1

考题 有下列程序: #includestdi0.h voidfun(int*a,int*b) {int*C; c=a;a=b;b=C; } voidmain( ) {intx=3,y=5,*p=&x,*q=&y; fun(p,q);printf("%d,%d,",*P,*q); fun(&x,&y);printf("%d,%d\n",*P,*q) } 程序运行后的输出结果是( )。A.3,5,5,3B.3,5,3,5C.5,3,3,5D.5,3,5,3

考题 有以下程序 include struct st { int x,y;} data[2]={1,10,2,20}; main( 有以下程序 #include <stdio.h> struct st { int x,y;} data[2]={1,10,2,20}; main() { struct st *p=data; printf("%d,",p->y); printf("%d\n",(++p)->x); } 程序的运行结果是______。A.10,1B.20,1C.10,2D.20,2

考题 有下列程序: #includestdi0.h voidmain( ) {inta[]={1,2,3,4),y,*p=&a[3]; --p;y=*p;printf("y=%d\n",y); } 程序的运行结果是( )。A.y=0B.y=1C.y=2D.y=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

考题 有以下程序#includestdio.hstruct ord{int x,y;} dt[2]={1,2,3,4};main(){struct ord*p=dt;printf(“%d,”,++(p一x));printf(“%d\n”,++(p一y));}程序运行后的输出结果是A.1,2B.4,1C.3,4D.2.3

考题 下面程序的运行结果是void swap(int *a,int *b){ int *t; t=a;a=b;b=t;}main(){ int x=3,y=5,*p=x,*q=y; swap(p,q); printf("%d%d\n",*p,*q);}

考题 以下程序的输出结果是include "stdio.h"int *f(int *x,int *y){ if(*x*y) return x; else return y;}main(){ int a=7,b=8, *p,*q,*r ; p=a; q=b; r= f(p,q); printf("%d,%d,%d\n",*p,*q,*r);}

考题 有以下程序:includemain(){inta[]={1,2,3,4},y,*p=a[3];--p;y=*p;printf("y=%d\n 有以下程序: #include<stdio.h> main() {inta[]={1,2,3,4},y,*p=a[3]; --p;y=*p;printf("y=%d\n",y); } 程序的运行结果是( )。A.y=0B.y=1C.y=2D.y=3

考题 以下程序的输出结果是()。includedefine F(x)2.84+xdefine w(y)printf("%d",(int)(y) 以下程序的输出结果是( )。 #include<stdio.h> #define F(x)2.84+x #define w(y)printf("%d",(int)(y)) #define P(y)w(y) main() {int x=2; P(F(5)*x); }A.12B.13C.14D.16

考题 有以下程序: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

考题 有以下程序:includemain(){int a[]={1,2,3,4},y,*p=--p;y=*p;printf("y=%d\n",y 有以下程序: #include<stdio.h> main() { int a[]={1,2,3,4},y,*p=&a[3]; --p;y=*p;printf("y=%d\n",y); } 程序的运行结果是( )。A.y=0B.y=1C.y=2D.y=3

考题 单选题有以下程序:#include main(){ int a[]={1,2,3,4},y,*p=a[3]; --p; y=*p; printf("y=%d",y);}程序的运行结果是(  )。A y=0B y=1C y=2D y=3

考题 单选题有以下程序:#include void fun(int*a,int*b){ int*c; c=a; a=b; b=c;}main(){ int x=3,y=5,*p=x,*q=y; fun(p,q); printf(%d,%d,*p,*q); fun(x,y); printf(%d,%d,*p,*q);}程序运行后的输出结果是(  )。A 3,5,5,3B 3,5,3,5C 5,3,3,5D 5,3,5,3