单选题 下列程序执行后,变量x的值为( )。

Dim a,b,c,d As Single

Dim x As Single

a=10

b=30

c=400

If b>a Then

d=a:a=b:b=d

End If

If b>c Then

x=b

Else If a>c Then

x=c

Else

x=a

End If

【正确答案】 B
【答案解析】[解析] 程序操作过程如下:
程序首先执行If b>a Theh语句,条件为真执行d=a:a=b:b=d语句,执行后d=10,a=30,b=10;然后执行If b>c Then语句,条件不成立,因此执行Else If a>c Then语句;条件不成立,因此执行Else后面的x=a语句,执行后x=30。