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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to tell if number is ODD or EVEN 1

Status
Not open for further replies.

FesterSXS

Programmer
Joined
Feb 4, 2002
Messages
2,196
Location
GB
Is there a simple function I can call that will tell me whether a number passed to it is ODD or EVEN?

thanks


Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 
Something like this ?
If YourNumber Mod 2 = 1 Then
WScript.Echo CStr(YourNumber) & " is odd"
Else
WScript.Echo CStr(YourNumber) & " is even"
End If

Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top