VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Better IsOdd

by Dave Katrowski (16 Submissions)
Category: Math/Dates
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (2 Votes)

Tell if a number is odd in one line of code. (and if its not odd its even, but i dont have to tell you that)

API Declarations
'none

Rate Better IsOdd

Function IsOdd(Var as integer)
IsOdd = -(Var And 1)
End Function

Download this snippet    Add to My Saved Code

Better IsOdd Comments

No comments have been posted about Better IsOdd. Why not be the first to post a comment about Better IsOdd.

Post your comment

Subject:
Message:
0/1000 characters