how check if the number is ODD or even

Other discussions about CSPro
Forum rules
New release: CSPro 8.0
Post Reply
jkajiba
Posts: 8
Joined: September 22nd, 2015, 1:40 pm

how check if the number is ODD or even

Post by jkajiba »

can someone help a logic to check if a number is even or ODD

thank you
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: how check if the number is ODD or even

Post by Gregory Martin »

You can check the remainder when dividing by two:
if VALUE % 2 = 0 then
    errmsg("VALUE is EVEN");
endif;
Post Reply