Odd numbers

Status
Not open for further replies.

Emma

Member
Is there a way to find out if a number input by a user is odd or even?

Thanks in anticipation,

Emma.:)
 
How about..

Right off the top of my head, without even thinking about it - Which is usually my problem :awink: ...

Code:
IF dValue = 0 THEN
    MESSAGE "You must enter a value!" VIEW-AS ALERT-BOX ERROR.
ELSE IF dValue MODULO 2 = 0 THEN
    MESSAGE "Value is even" VIEW-AS ALERT-BOX INFORMATION.
ELSE
    MESSAGE "Value is odd" VIEW-AS ALERT-BOX INFORMATION.
 
Status
Not open for further replies.
Back
Top