Solved

Is even or odd?

Posted on 2000-03-03
4
310 Views
Last Modified: 2011-09-20
Does someone have a function in which I can pass an
Integer and it would return True if Even or False if odd?

Please be clear in your answer, I am new to ASP.

0
Comment
Question by:blue021097
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 50 total points
ID: 2581555
Function EvenOrOdd(num)

 If ((num / 2) * 2) = num Then
   EvenOrOdd = True
 Else
   EvenOrOdd = False
 End If

End Function
0
 

Author Comment

by:blue021097
ID: 2581645
(Edited by Computer101), it is not working.
0
 
LVL 32

Expert Comment

by:jhance
ID: 2581673
Well what's it doing?
0
 
LVL 32

Expert Comment

by:jhance
ID: 2581683
OK, I see the problem.  Try it like this:

Function EvenOrOdd(num)

                     If (Int((num / 2)) * 2) = num Then
                       EvenOrOdd = True
                     Else
                       EvenOrOdd = False
                     End If

End Function
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question