更多"下面程序的结果为 #include'iostream.h' voi"的相关试题:
[单项选择]下面程序的结果为
#include" iostream.h"
void change(int a,int b)
int temp;
temp=a;
a=b;
b=temp;
void main( )
int m,n;
m=8;
n=9;
change(m,n);
tout < < m < < " " < < n < < end1;
A. 8 9
B. 9 8
C. 程序有错误
D. 9 9
[填空题]
以下程序运行时输出结果是()。
#include
void change(int x,int Y,int *z)
{ int t;
t=x;x=y;y=*z;*z=t;
}
void main( )
{ int x=18,y=27,z=63;
change(x,y,&z);
printf("x=%d,y=%d,z=%d/n",x,y,z);
}
[单项选择]下面程序的结果为 #include"iostream.h" void change(int a,int b) { int temp; temp=a; a=b; b=temp; } void main( ) { int m,n; m=8; n=9; change(m,n); cout<<m<<" "<<n<<endl; }
A. 8 9
B. 9 8
C. 程序有错误
D. 9 9
[单项选择]下面程序的结果为( )。 #include"iostream.h" void change (int a,int b) int temp; temp=a; a=b; b=temp: void main( ) int m,n; m=8; n=9; change(m,n): cout << m<<" "<< n << endl;
A. 89
B. 98
C. 程序有错误
D. 99
[填空题]下面程序的运行结果是 【18】 。
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);
[填空题]下面程序和运行运行结果是【 】。
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);}
[填空题]下面程序的运行结果是 【18】 。
void swap(int *a,int *b)
{
int *tp;
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);
}
[填空题]下面程序的运行结果是 【18】 。
void swap(int *a,int *b)
int *tp;
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);
[填空题]
下面程序和运行运行结果是 【18】 。
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);}
[单项选择]下面程序的运行结果为
#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