Notifications
Announcements
Hi, is there any way to check if an integer is even or odd?
*This post is locked for comments
Hi Youssef, thank you.
If ( #yournumber MOD 2) = 0 then
Message('even')
Else
Message('odd');
[int] mod 2 ==1 ??
Use the MOD operator.
X MOD 2 will result in 0 or 1, when X is respectively even or odd.
Funny is that the MOD operator is not (well) documented. But read some about it here www.mibuso.com/.../viewtopic.php
If ( [tag:yournumber] MOD 2) = 0 then
Hi, use the MOD 2 function to check if there's a remainder then it's odd if not it's even
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
HoangNam 7