有下列程序: include
voidmain( )include<stdi0.h>
voidmain( )
{intx=1,y=2,z=3;
if(x>y)
if(y<z)print{("%d",++z);
elseprintf("%d",++y);
printf(”%d\n”,x++);
}
程序的运行结果是( )。
A.331
B.41
C.2
D.1
第1题:
以下程序的输出结果是 #include<iostream.h> void main( ) {int x=1,y=3; cout << x++ << ","; {int x=0;x+=y*2; cout <<X <<"," <<y << ","; } cout << x <<","<< y; }
A.1,6,3,1,3
B.1,6,3,6,3
C.1,6,3,2,3
D.1,7,3,2,3
第2题:
以下程序的输出结果是 #include<iostream.h> void main() { int x=1,y=3; cout << x++ << " , "; { int x=0;X+=y*2; cout<<x<<" ,"<<y<<" ;"; } cout<<x<<" ,"<<y; }
A.1,6,3,1,3
B.1,6,3,6,3
C.1,6,3,2,3
D.1,7,3,2,3
第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 <stdio.h> main() { int x=3,y=2,z=1; printf("%d\n",x/y&~z); 程序运行后的输出结果是( )。
A.3
B.2
C.1
D.0
第5题:
对于下面的程序,说法正确的是 #include<iostream.h> void main( ) { int x=3,y=4,z=2; if(X=y+z) cout <<"x=y+Z"; else cout<<"x!=y+Z";}
A.不能通过编译
B.输出6
C.输出x! =y+z
D.输出x=y+z