全球旧事资料 分类
选择结构练习题
一、选择题1下列错误的语句是()A.ifabpri
tf“d”aB.ifamC.if1amelsea
D.ifa0elsea
2i
cludestdiohmai
i
txysca
f“d”xy0ifx0
ifx0y1elsey1pri
tf“d”y当从键盘输入32时,程序输出结果为()A0B1C1D不确定值2以下程序的输出结果是()i
cludestdiohmai
{i
ta2b1c2ifab
ifb0c0elsec1pri
tf“d
”c}
A0B1C2D34以下程序的输出结果是()i
cludestdiohmai
i
tk2
switchkcase1pri
tf“d
”kbreakcase2pri
tf“d”kcase3pri
tf“d
”kbreakcase4pri
tf“d
”kdefaultpri
tf“Full
”A13B23C22D325下列程序的运行结果是()i
cludestdioh
1
fmai

i
ta2c5
pri
tf“adbd
”ac

Aa2b5Ba2b5
Cacbd
Dadbd
6语句prit
f“abre’hi’ybou
”的输出结果是()
Aabre’hi’ybouBabre’hi’ybou
Cre’hi’you
Dabre’hi’ybou
7如下程序的输出结果是()
i
cludestdioh
mai

i
ta12b5c3
ifab
ifb0c0
elsec
pri
tf“d
”c

A0B1C2D38从键盘输入5,下列程序运行结果是()
i
cludestdioh
mai
{i
tx
sca
f“d”x
ifx5pri
tf“d”x
elsepri
t“d”x}
A3B4C5D69如下程序的输出结果是()
i
cludestdioh
mai

i
ta15b21m0
switcha3
case0mbreak
case1m
switchb2
defaultm
case0mbreak


pri
tf“d
”m10下面的程序()
i
cludestdioh
mai
{i
tx3y0z0
ifxzypri
tf“”
2
felsepri
tf“”}A有语法错误不能通过编译B输出C可以通过编译,但是不能通过连接,因而不能运行D输出11两次运行下面的程序,如果从键盘上分别输入6和4,则输出结果是()
i
cludestdioh
mai
{i
tx
sca
f“d”x
ifx5pri
tf“d”xelsepri
tf“d
”x}
A75B63C74D6412以下程序输出结果是()
i
cludestdioh
mai
{i
ta1b4k
ka0b0pri
tf“ddd
”kab}
A104B003C103D00413能正确表示a≥10或a≤0的关系表达式是()
Aa10ora0Ba10a0
Ca10a0Da10a014假定所有变量均已正确说明,下列程序段运行后x的值是()
abc0x35
ifax
elseifb
ifcx3
elsex4
A34B4C35D315表示关系X≤Y≤Z的C语言表达式为()A.XYYZBXYa
dYZ
CXYZ
DXYYZ
16如下程序的输出结果为()
i
cludestdioh
mai
{i
tabc246
ac1009
b11
pri
tf“dd
r
好听全球资料 返回顶部