Jump to content

Integer comparison: Difference between revisions

Integer comparison in various BASIC dialents
(Emacs Lisp: Improve solution)
(Integer comparison in various BASIC dialents)
Line 681:
180 PRINT A;"is greater than ";B
190 END SELECT</lang>
 
==={{header|BASIC256}}===
<lang freebasic>input "Please enter one integer: ", x
input "and a second integer: ", y
 
if x < y then print x; " is less than "; y
if x = y then print x; " is equal to "; y
if x > y then print x; " is greater than "; y</lang>
 
==={{header|QBasic}}===
<lang qbasic>INPUT "Please enter two integers, separated by a comma: ", x, y
 
IF x < y THEN PRINT x; " is less than "; y
IF x = y THEN PRINT x; " is equal to "; y
IF x > y THEN PRINT x; " is greater than "; y</lang>
 
==={{header|True BASIC}}===
<lang qbasic>PRINT "Please enter two integers, separated by a comma: ";
INPUT x, y
 
IF x < y THEN PRINT x; " is less than "; y
IF x = y THEN PRINT x; " is equal to "; y
IF x > y THEN PRINT x; " is greater than "; y
END</lang>
 
==={{header|Yabasic}}===
<lang yabasic>input "Please enter two integers, separated by a comma: " x, y
 
if x < y then print x, " is less than ", y : fi
if x = y then print x, " is equal to ", y : fi
if x > y then print x, " is greater than ", y : fi</lang>
 
==={{Header|Tiny BASIC}}===
2,136

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.