Sha256: 8d67f6aca9ffe3061bfd423007f647e52b9a1add3405bca54bf6c5c66d25f745

Contents?: true

Size: 498 Bytes

Versions: 10

Compression:

Stored size: 498 Bytes

Contents

' FB 1.05.0 Win64

Dim As Integer i, j
Input "Enter two integers separated by a comma"; i, j
Print i;" + "; j; " = "; i + j
Print i;" - "; j; " = "; i - j
Print i;" * "; j; " = "; i * j
Print i;" / "; j; " = "; i \ j
Print i;" % "; j; " = "; i Mod j 
Print i;" ^ "; j; " = "; i ^ j
Sleep

' Integer division (for which FB uses the '\' operator) rounds towards zero

' Remainder (for which FB uses the Mod operator) will, if non-zero, match the sign
' of the first operand

Sample input and output:-

Version data entries

10 entries across 7 versions & 1 rubygems

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