Notices
Results 1 to 3 of 3

Thread: Can't figure decent difference...

  1. #1 Can't figure decent difference... 
    Forum Sophomore
    Join Date
    Jan 2006
    Posts
    100
    I have started a programming project, but
    now I have a "critical error", I can't found
    a decent way to tell program how to seperate
    "even"-numbers (2,4,6,8 etc...) from
    "odd" numbers (1,3,5,7 etc...).

    So can anyone tell me what actually
    sets odd apart from even? And what
    is the formula for that?


    Reply With Quote  
     

  2.  
     

  3. #2  
    Forum Ph.D.
    Join Date
    Nov 2005
    Location
    Columbus, OH
    Posts
    935
    It's been a while since I've programmed, but something like:

    If xmod2 == 0
    { Even = True; }
    else
    { Even = False; }

    or however you'd want to do it.


    Reply With Quote  
     

  4. #3  
    Forum Sophomore
    Join Date
    Jan 2006
    Posts
    100
    Well, I try that... thanks for your help Neutrino.
    Reply With Quote  
     

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