Dim a, b As Integer
Dim c, d, e As Boolean
c = True
d = False
a = 10
b = 3
'MsgBox "a+b=" & (a + b)
'MsgBox "a-b=" & (a - b)
'MsgBox "a*b=" & (a * b)
'MsgBox "a/b=" & (a / b)
MsgBox "a\b=" & (a \ b)
'MsgBox "次方 a^b=" & (a ^ b)
'MsgBox "餘數 a mod b=" & (a Mod b)
MsgBox "兩樣同時符合 c and d=" & (c And d)
MsgBox "c or d=" & (c Or d)
MsgBox "Not c is" & (Not c)
'MsgBox "a=b" & (a = b)
'MsgBox "a<b" & (a < b)
'MsgBox "a>b" & (a > b)
'MsgBox "a<=b" & (a <= b)
'MsgBox "a>=b" & (a >= b)
'MsgBox "a<>b=" & (a <> b)
End Sub
- \ 除後排除小數點。 10.6 -> 10
- ^ 次方。 ^(1/2) 開方
- Mod 餘數
- And 符合兩個條件。True And False -> False
- Or 符合其中一個條件。True And False -> True
- Not 相反。 Not True -> False
- <> 不等於
沒有留言:
張貼留言