Results 1 to 2 of 2

Thread: Checking Odd and Even number

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2000
    Posts
    17

    Question

    Hi there!!

    Here's a simple question!!
    How do I check if a number is odd or even??

    Regards!!

  2. #2
    Addicted Member tcurrier's Avatar
    Join Date
    May 1999
    Location
    Northeastern Pa./USA
    Posts
    255
    Try dividing it by 2 and see if there is a remainder:

    If your_number mod 2 = 0 then
    msgbox "no remainder, your number is even"
    Else
    msgbox "is a remainder, your number is odd"
    End if

    VB6 Enterprise SP4

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width