1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-07-26 21:29:48 +00:00
millfork/examples/c64/calculator.mfk

27 lines
492 B
Plaintext
Raw Normal View History

import stdio
import c64_basic
void main() {
word a
word b
putstrz("enter first number:{n}"z)
a = readword()
while readword_err != 0 {
putstrz("that wasn't a number, try again:{n}"z)
a = readword()
}
putstrz("enter second number:{n}"z)
b = readword()
while readword_err != 0 {
putstrz("that wasn't a number, try again:{n}"z)
b = readword()
}
putstrz("the sum is:{n}"z)
a += b
putword(a)
putchar(13)
}