954,480 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Modulus Operator Question...

How can I use this to find out if the number I imputed is odd or even???

40ounce68
Newbie Poster
6 posts since Feb 2005
Reputation Points: 10
Solved Threads: 0
 
if (number % 2 == 0)
  // even
else
  // odd
Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You