Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
20
Task/Arithmetic-Integer/QB64/arithmetic-integer.qb64
Normal file
20
Task/Arithmetic-Integer/QB64/arithmetic-integer.qb64
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
START:
|
||||
INPUT "Enter two integers (a,b):"; a!, b!
|
||||
IF a = 0 THEN END
|
||||
IF b = 0 THEN
|
||||
PRINT "Second integer is zero. Zero not allowed for Quotient or Remainder."
|
||||
GOTO START
|
||||
END IF
|
||||
PRINT
|
||||
PRINT " Sum = "; a + b
|
||||
PRINT " Difference = "; a - b
|
||||
PRINT " Product = "; a * b
|
||||
' Notice the use of the INTEGER Divisor "\" as opposed to the regular divisor "/".
|
||||
PRINT "Integer Quotient = "; a \ b, , "* Rounds toward 0."
|
||||
PRINT " Remainder = "; a MOD b, , "* Sign matches first operand."
|
||||
PRINT " Exponentiation = "; a ^ b
|
||||
PRINT
|
||||
INPUT "Again? (y/N)"; a$
|
||||
IF UCASE$(a$) = "Y" THEN CLS: GOTO START
|
||||
CLS
|
||||
END
|
||||
Loading…
Add table
Add a link
Reference in a new issue