Odd & Even

Ok I’m bad at math but i know what i need so here are two function one is to find out if a given number is odd or Even 😛 yeah i know worthless if you need it,in another language just tell.

Option Explicit
‘**********************************************
‘Function : Odd & Even
‘Author : Kreshnik Hasanaj
‘E-Mail : kresha7@hotmail.com
‘Purpose : Find if a number is Odd or Even
‘**********************************************
Public Function Odd(i As Long) As Boolean

If Not (i Mod 2) = 0 Then
Odd = True
Else
Odd = False
End If

End Function
Public Function Even(j As Long) As Boolean

If j Mod 2 = 0 Then
Even = True
Else
Even = False
End If

End Function

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s