A+B: Difference between revisions

534 bytes added ,  6 months ago
Added XBasic
imported>Lacika7
(Added XBasic)
Line 1,646:
Loop
Return (b@)</syntaxhighlight>
 
==={{header|XBasic}}===
{{works with|Windows XBasic}}
<syntaxhighlight lang="qbasic">PROGRAM "A+B"
VERSION "0.0000"
 
DECLARE FUNCTION Entry ()
 
FUNCTION Entry ()
a$ = INLINE$("Enter integer A: ")
a = SLONG(a$)
b$ = INLINE$("Enter integer B: ")
b = SLONG(b$)
DO WHILE 1
IF ABS(a) > 1000 OR ABS(b) > 1000 THEN
PRINT "Both integers must be in the interval [-1000..1000] - try again."
PRINT
ELSE
PRINT "Their sum is"; a + b
EXIT DO
END IF
LOOP
END FUNCTION
END PROGRAM</syntaxhighlight>
 
=={{header|Batch File}}==
2,122

edits