资源描述
练一练:
1.设a=2,b=3,在VB中,表达式a>b And b>=3值是 。
A.1 B.-1
C.True D.False
2.已知变量x 和y 的值分别是6 和5,那么以下运算结果为True 的表达式是 。
A.Not(x>y) B.(x<5)or(y>6)
C.(x>=6)And(y>=5) D.Not(x>4)
3.下列程序运行后,变量 Value 的值是 。
X=20
if x>=10 then
Value=5*x
Else
Value=4*x
End if
A.100 B.80 C.40 D.20
4.设a=2,b=3,在VB中,表达式Not(a>b)值是 。
A.1 B.0
C.True D.False
5.下列程序段运行后,m的值为 。
a = 7,b = 2,c = 23
If a > b Then
m = a
Else
m = b
End if
If c > m Then
m = c
End if
A.7 B.2 C.23 D.提示错误,无答案
6.如果X=-25,则运行x=Abs(x);x=sqr(x)后,x 的值是 。
A.5 B.-5 C.25 D.-25
7.下列逻辑运算结果为"true"的是______。
A.flase or not true B.flase and not true
C.true or not true D.true and not true
8.已知a=8、b=6,以下程序段
If (a Mod 3 = 0) Or (b Mod 3 = 0) Then
c = a * b
Else
c = a + b
End If
执行后变量c的值为 。
A.48 B.14 C.8 D.6
展开阅读全文