下面程序的运行结果是( )。define EXCH(a,B){int t;t=a;a=b;b=t;}main(){int x=1,y=2;EXCH(x,y);printf("x=%d,y=%d\n",x,y);}

下面程序的运行结果是( )。

define EXCH(a,B){int t;t=a;a=b;b=t;}

main()

{int x=1,y=2;

EXCH(x,y);

printf("x=%d,y=%d\n",x,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,

下面程序的运行结果是 include void fun(int * a,int * b) { int x= * a; * a= * 下面程序的运行结果是#include<iostream.h>void fun(int * a,int * b){int x= * a;* a= * b; * b=X;cout < < * a < < * b < <" ";}void main( ){int x=1,y=2;fun(x,y) ;cout < < X < < y < < endl;}A.12 12B.12 21C.21 12D.21 21

有以下程序#include stdio.hvoid exch(int t[ ]){ t[0]=t[5]; }main( ){ int x[10]={1,2,3,4,5,6,7,8,9,10),i=0;while(i=4){ exch(x[i]); i++; }for( i=0; 15;i++) printf(”%d",x[i]);.printf( "\n");}程序运行后输出的结果是A) 2 4 6 8 10B) 1 3 5 7 9C) 1 2 3 4 5D) 6 7 8 9 10

下面程序的运行结果是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);}

有以下程序: #includestdio.h void exch(int t[]) { t[0]=t[s];} main( ) { int x[10]={1,2,3,4,5,6,7,8,9,10},i=0; while(i=4){exch(x[i]);i++;} for(i=0;i5;i++)printf("%dl"x[i]); printf("\n"); } 程序运行后输出的结果是( )。A.2 4 6 8 10B.1 3 5 7 9C.1 2 3 4 5D.6 7 8 9 10

下面程序的运行结果是includevoid fun(int*a,int*b){int X= *a;* a= *b;*b=X;cout 下面程序的运行结果是 #include<iostream,h> void fun(int*a,int*b) { int X= *a; * a= *b; *b=X; cout<< *a<< *b<<" "; void main() int x=1, y=2; fun(x,y); cout<<X<<y<<end1; }A.12 12B.12 21C.21 12D.21 11

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

下面程序和运行运行结果是【 】。void swap(int * a,int * b){ int * t;t=a; a=b; b=t;}main( ){ intx=3,y=5,* p=&x,* q=&y;swap(p,q);prinff("%d %d\n", *p, *q);}

运行程序,程序输出结果是(). void sub (int *s, int *y ) { static int t=3 ; *y=s[t] ; t - -; } int main() { int a[ ]={1,2,3,4}, i , x=0; for (i = 0; i<4; i++) { sub (a,x ) ; cout<<x;} cout<<endl; return 0 ; }A.4321B.1234C.0000D.4444