Sha256: 05c5934acc84fd0a3b50c5e579d2ea4fd6b9d2e940a364eda55e9ea2a56ea43f

Contents?: true

Size: 606 Bytes

Versions: 10

Compression:

Stored size: 606 Bytes

Contents

'Arithmetic - Integer
Sub RosettaArithmeticInt()
Dim opr As Variant, a As Integer, b As Integer
On Error Resume Next

a = CInt(InputBox("Enter first integer", "XLSM | Arithmetic"))
b = CInt(InputBox("Enter second integer", "XLSM | Arithmetic"))

Debug.Print "a ="; a, "b="; b, vbCr
For Each opr In Split("+ - * / \ mod ^", " ")
    Select Case opr
        Case "mod":     Debug.Print "a mod b", a; "mod"; b, a Mod b
        Case "\":       Debug.Print "a \ b", a; "\"; b, a \ b
        Case Else:      Debug.Print "a "; opr; " b", a; opr; b, Evaluate(a & opr & b)
    End Select
Next opr
End Sub

Version data entries

10 entries across 7 versions & 1 rubygems

Version Path
zettacode-0.1.7 files.zettacode/arithmetic.integer/vba.txt
zettacode-0.1.6 files.zettacode/arithmetic.integer/vba.txt
zettacode-0.1.6 files.zettacode2/arithmetic.integer/vba.txt
zettacode-0.1.5 files.zettacode/arithmetic.integer/vba.txt
zettacode-0.1.5 files.zettacode2/arithmetic.integer/vba.txt
zettacode-0.1.4 files.zettacode/arithmetic.integer/vba.txt
zettacode-0.1.4 files.zettacode2/arithmetic.integer/vba.txt
zettacode-0.1.3 files.zettacode/arithmetic.integer/vba.txt
zettacode-0.1.2 files.zettacode/arithmetic.integer/vba.txt
zettacode-0.1.1 zettacode.files/arithmetic.integer/vba.txt