A+B: Difference between revisions
Content added Content deleted
imported>Lacika7 |
(Added XBasic) |
||
Line 1,646: | Line 1,646: | ||
Loop |
Loop |
||
Return (b@)</syntaxhighlight> |
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}}== |
=={{header|Batch File}}== |