下面程序的输出结果是 ______。 #include<iostream.h> void main(){ int x=20; int &y=x; cout<<(x==y)<<“”; cout<<(&x==&y)<<end1: }
A.20 20 20 20
B.20 20
C.1 1
D.出错
第1题:
以下程序的执行结果是______。
include<iostream.h>
void main()
{
int x=5 y=2;
cout<<! (y==x/2)<<",";
cout<<(y!=x%3)<<",";
cout<<(x>0 && y<0=<<",";
cout<<(x!=y||x>=y)<<endl;
}
第2题:
下面程序的输出结果是【 】。
include<iostream.h>
int add(int a, int b);
void main()
{
extern int x, y;
cout<<add(x, y)<<end1;
}
int x(20),y(5);
int add(int a, int b)
{
int s=a+ b;
return s;
}
第3题:
下面程序的输出结果是( )。#include<iostream.h>void main(){int x=-1,y=5,z;z=(x++<0)&& (y-->=0);cout<<x<<'\t'<<y<<'\t'<<z<<end1;}
A.-1 5 0
B.-1 4 1
C.0 4 1
D.0 4 0
第4题:
下列程序段的输出结果是 #include<iostream.h> void fun(int * x,int * y) { cout << * X << * y; *X=3; *y=4; } void main() { int x=1,y=2; fun(&y,&x); cout << X << y<<endl; {
A.2143
B.1212
C.1234
D.2112
第5题:
下列程序段的输出结果是 #include<iostream.h> void fun(int*x,int*y) {cout<<*x<<*y; *X=3; *y=4; } void main() {int x=1,y=2; fun(&y,&x); cout<<X<<y<<endl; }
A.2143
B.1212
C.1234
D.2112