[单选题]

下面程序的运行结果为 include void swap(int &a, int b) { int temp; temp=a

下面程序的运行结果为

#include<iostream.h>

void swap(int &a, int b)

{

int temp;

temp=a++;

a=b;

b=temp;

}

void main( )

int a=2,b=3;

swap(a, b) ;

cout < < a < <"," < < b < < endl;

}

A.2,3

B.3,2

C.2,2

D.3,3

参考答案与解析:

相关试题

下面程序的运行结果是void swap(int *a,int *b){ int

[主观题]下面程序的运行结果是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 void fun(int * a,int

    [单选题]下面程序的运行结果是 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;

  • 查看答案
  • 下列程序的运行结果为 #include void main( ) { int a

    [单选题]下列程序的运行结果为 include void main( ) { int a=2; int b=a£«1; cout < < a£¯b下列程序的运行结果为#include<iostream.h>void main( ){int a=2;int b=a+1;cout < < a/b < < endl;}A.0.66667B.0C.0.7D.0.66666666…

  • 查看答案
  • 下列程序的运行结果为()。#include void main(){int a=

    [单选题]下列程序的运行结果为()。include void main(){int a=2;int b=a£«1;cou<下列程序的运行结果为( )。 #include<iostream.h> void main() { int a=2; int b=a+1; cou<<afo<<endl; }A.0.66667B.0C.0.7D.0.66666666

  • 查看答案
  • 下面程序的运行结果是 #include Void main( ) { int n

    [单选题]下面程序的运行结果是 include Void main( ) { int num=1; int &ref=num;ref=下面程序的运行结果是#include<iostream.h>Void main( ){int num=1;int &ref=num;ref=ref+2;cout < < num;num=num+3;cout < < ref < <endl;}A.13B.16C.36D.33

  • 查看答案
  • 下面程序的运行结果是 #include void main( ) { int i

    [单选题]下面程序的运行结果是 include void main( ) { int i=1; while(i <=8) if(£«£«i%3!下面程序的运行结果是#include<iostream.h>void main( ){int i=1;while(i <=8)if(++i%3!=2) continue;else cout < < i;}A.25B.36C.258D.369

  • 查看答案
  • 下面程序的运行结果为()。#includevoid swap(int &a,in

    [单选题]下面程序的运行结果为()。includevoid swap(int &a,int B) {int temp;temp=a£«£«;下面程序的运行结果为( )。 #include<iostream.h> void swap(int &a,int B) { int temp; temp=a++; a=b; b=temp; } void main() { int a=2,b=3; swap(a,b); cout<<a<<“,”<<b<<end1; }A.2,3B.3,2C.2,2D.3

  • 查看答案
  • 下面程序的运行结果为#includeVoid swap(int &a,int b

    [单选题]下面程序的运行结果为includeVoid swap(int &a,int b){int temp;temp=a£«£«;a=b;下面程序的运行结果为 #include<iostream,h> Void swap(int &a,int b) { int temp; temp=a++; a=b; b=temp; } void main() { int a=2,b=3; swap(a,b); cout <<a <<”,” <<b <<end1 }A.2,3B.3,2C.2,2D.3,

  • 查看答案
  • 下列程序的运行结果为#include void main( ){ int a=2

    [单选题]下列程序的运行结果为include void main( ){ int a=2; int b=a£«l; cout < < a£¯b下列程序的运行结果为 #include < iostream.h > void main( ) { int a=2; int b=a+l; cout < < a/b < < end1; }A.0.66667B.0C.0.7D.0.66666666…

  • 查看答案
  • 有以下程序: #include void swap1 (int c0[],int

    [单选题]有以下程序: include void swap1 (int c0[],int e1[] ){intt;t = c0[0]; c0[0]: c1 [有以下程序: #include <stdio, h>void swap1 (int c0[],int e1[] ){ int t; t = c0[0]; c0[0]: c1 [0] ; c1 [0] = t;}void swap2(int * c0,int * c1){ int t; t= *c0; *c0= *c1; * c1 =t;}main(

  • 查看答案