September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
12
Task/Arithmetic-Integer/BASIC/arithmetic-integer-2.basic
Normal file
12
Task/Arithmetic-Integer/BASIC/arithmetic-integer-2.basic
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
' Arthimetic/Integer
|
||||
DECLARE a%, b%
|
||||
INPUT "Enter integer A: ", a%
|
||||
INPUT "Enter integer B: ", b%
|
||||
PRINT
|
||||
|
||||
PRINT a%, " + ", b%, " is ", a% + b%
|
||||
PRINT a%, " - ", b%, " is ", a% - b%
|
||||
PRINT a%, " * ", b%, " is ", a% * b%
|
||||
PRINT a%, " / ", b%, " is ", a% / b%, ", trucation toward zero"
|
||||
PRINT "MOD(", a%, ", ", b%, ") is ", MOD(a%, b%), ", same sign as first operand"
|
||||
PRINT "POW(", a%, ", ", b%, ") is ", INT(POW(a%, b%))
|
||||
8
Task/Arithmetic-Integer/BASIC/arithmetic-integer-3.basic
Normal file
8
Task/Arithmetic-Integer/BASIC/arithmetic-integer-3.basic
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
10 INPUT "ENTER A NUMBER"; A%
|
||||
20 INPUT "ENTER ANOTHER NUMBER"; B%
|
||||
30 PRINT "ADDITION:";A%;"+";B%;"=";A%+B%
|
||||
40 PRINT "SUBTRACTION:";A%;"-";B%;"=";A%-B%
|
||||
50 PRINT "MULTIPLICATION:";A%;"*";B%;"=";A%*B%
|
||||
60 PRINT "INTEGER DIVISION:";A%;"/";B%;"=";INT(A%/B%)
|
||||
70 PRINT "REMAINDER OR MODULO:";A%;"%";B%;"=";A%-INT(A%/B%)*B%
|
||||
80 PRINT "POWER:";A%;"^";B%;"=";A%^B%
|
||||
15
Task/Arithmetic-Integer/BASIC/arithmetic-integer-4.basic
Normal file
15
Task/Arithmetic-Integer/BASIC/arithmetic-integer-4.basic
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
! RosettaCode: Integer Arithmetic
|
||||
! True BASIC v6.007
|
||||
! Translated from BaCon example.
|
||||
PROGRAM Integer_Arithmetic
|
||||
INPUT PROMPT "Enter integer A: ": a
|
||||
INPUT PROMPT "Enter integer B: ": b
|
||||
PRINT
|
||||
PRINT a;" + ";b;" is ";a+b
|
||||
PRINT a;" - ";b;" is ";a-b
|
||||
PRINT a;" * ";b;" is ";a*b
|
||||
PRINT a;" / ";b;" is ";INT(a/b);
|
||||
PRINT "MOD(";a;", ";b;") is "; MOD(a,b)
|
||||
PRINT "POW(";a;", ";b;") is ";INT(a^b)
|
||||
GET KEY done
|
||||
END
|
||||
Loading…
Add table
Add a link
Reference in a new issue