September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
|
|
@ -1,8 +1,15 @@
|
|||
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%
|
||||
! 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