Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Number Odd or Even 2

Status
Not open for further replies.

sharedworld

Programmer
Dec 25, 2003
65
US
I'm looking for a function that tell's me if a number is odd or even. It's to check if the day from the date is Odd or Even
 
sharedworld:

I'm not sure of any function as of now, I'll see if I can find one, but off of the top my head I would suggest seeing if the number is divisable by 2. If it's divisable by 2 then it's even, otherwise it's odd.

Did this help?

Say 'ello..... to my little friend!
 
sharedworld:

It just dawned on me... you can make your own function to achieve your goal. Just create you function to except a number, and use the logic I suggested in my previous reply.

Say 'ello..... to my little friend!
 
Thank's kocheach, but what's means divided by 2, i thinked on it already, but a number is always dividable by 2, for example 3 divides by 2 it's 1.5, so could you explain to me what do you mean, thank's
 
Hello sharedworld,
Code:
intTest=5
msgbox IsOdd(intTest)

function IsOdd(intX)
	if (intX mod 2)=0 then IsOdd=false else IsOdd=true
end function
regards - tsuji
 
thank's foxbox, i'm giving you a star for your post, thank's guys
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top