RosettaCodeData/Task/Conditional-structures/M2000-Interpreter/conditional-structures-2.m2000

16 lines
278 B
Plaintext

Module Checkit {
Read x
Print If(x>100-> 100, x)
}
Checkit 30
Checkit 300
\\ we can use more than two expressions, if i is not in range then 0 returned
Module Checkit {
Read i,x
Print If(i-> x*5, x*40, x*500)
}
Checkit 1, 20
Checkit 2, 20
Checkit 3, 20