RosettaCodeData/Task/A+B/Xojo/a+b.xojo
2023-07-01 13:44:08 -04:00

26 lines
540 B
Text

var inp as string
var strVals() as string
print("Enter two numbers separated by a space:")
do
inp = input
strVals = inp.split(" ")
var a, b as integer
a = strVals(0).toInteger
b = strVals(1).toInteger
if a < -1000 or b > 1000 then
print("The first number should be greater than or equal to -1000 and the second number should be less " + _
"than or equal to 1000. Please re-enter:")
continue
end
var result as integer = a + b
print(a.toString + " + " + b.toString + " = " + result.toString)
exit
loop