10 lines
387 B
Text
10 lines
387 B
Text
set num to random of 100 -- start with a random number from 1 to 100
|
|
|
|
// use the 'is a' operator to test the value
|
|
if num is an odd number then put num & " is odd"
|
|
|
|
// see if num is divisible by 2
|
|
if num is divisible by 2 then put num & " is even (is divisible by 2)"
|
|
|
|
// check to see if the remainder is 0 when dividing by 2
|
|
if num rem 2 is 0 then put num & " is even (zero remainder)"
|