单项选择题

有如下程序
#include<iostream.h>
void main( )

float x=2.O,y;
if(x<O.0)y=0.0;
else if(x<10.O)y=1.0/x;
else y=1.0;
cout<<y;

该程序的输出结果是

A.0
B.0.25
C.0.5
D.1.0
<上一题 目录 下一题>
热门 试题

单项选择题
下列程序的输出结果是 #include<iostream.h> void main( ) char*str= 12123434 ; int xl=0,x2=0,x3=0,x4=0,i; for(i=0;str[i]!=’ 0’;i++) switch(str[i]) case’1’:x4++; case’2’:x3++; case’3’:x2++; case’4’:x1++; cout<<x1<< , <<x2<< , <<x3<< , <<x4;
A.8,6,4,1
B.8,6,3,2
C.8,8,4,1
D.8,6,4,2
单项选择题
下列程序段的输出结果是 #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
相关试题
  • 有如下程序: #include iostrearn.h v...