| Visual Basic Programming Help?

Visual Basic Programming Help?

tantrevor07 asked:

Hi, im a little new to programming and i need help in here
hehe a bit stuck :P
ok, the problem is how do i program or what is the syntax for determining ODD from EVEN

what i’m trying to make is when you input a number is it will display if its ODD or EVEN
redregistrar.com

Related posts:

  1. Visual Basic Programming Help? michbox asked: okay i created a simple income calculator but...
  2. visual basic programming? samuel s asked: trying to write the code to get...
  3. Does knowing Visual Basic allow me to skip my C++ class? winback asked: I have taken an intro to Visual Basic...
  4. why is visual basic a good programming language to use? Hussain A asked: why is visual basic a good programming...
  5. Can anybody send me some notes for MS visual basic programming? Jaya asked: I am a biginer of in programming in...

Filed Under Programming & Design |

Tagged With , ,

Comments

4 Responses to “Visual Basic Programming Help?”

  1. allangallop on June 18th, 2009 10:04 am

    “Public Function IsEven(ByVal Number As Long) As Boolean
    IsEven = (Number Mod 2 = 0)
    End Function”

  2. Dennis S on June 18th, 2009 2:44 pm

    divide the number by 2. If you have a remainder then it’s odd.

  3. Chris C on June 19th, 2009 2:48 am

    Use the MOD function.

    If myVariable MOD 2 = 0 Then
    ‘ This is where the variable’s value is even
    Else
    ‘ This is where the variable’s value is odd
    End If

  4. ? on June 20th, 2009 9:51 am

    Dim myNum as Long
    myNum = Val(Text1)

    If myNum Mod 2 Then
    MsgBox “You’ve entered an odd number.”
    Else
    MsgBox “You’ve entered an even number.”
    End If