Skip to main content
gamedev.net
🔒 Locked

C++ question

Started by Naseri 2 replies 600+ views
Original Post
Naseri
Naseri
Can anyone explain how to make a function in c++ that tests if a number is odd or even ? (i am very new to c++ programming) Thanks
Abcd_z
Abcd_z
Um, sure. You would use the divisor operation, like this:

IF X % 2 = 0
THEN whatever,

Where X is the number you need to test for.

If you would criticize another person, you must first walk a mile in their moccasins. That way, If they get mad, they''ll be a mile away and barefoot.
If you would criticize another person, you must first walk a mile in their moccasins. That way, If they get mad, they'll be a mile away and barefoot.
Naseri
Naseri
Thanks a lot for helping me with my problem

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.