if statment

This is a discussion on if statment within the C++ Programming forums, part of the General Programming Boards category; How would i say if x is a even number.... or x is an odd number....?...

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    58

    if statment

    How would i say if x is a even number.... or x is an odd number....?

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    79
    if (x % 2 == 0) // i.e. if x is an even number

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 13
    Last Post: 09-24-2008, 07:16 PM
  2. How to cast a ListBox item to an int for a switch statment?
    By Swaine777 in forum C++ Programming
    Replies: 8
    Last Post: 09-26-2004, 09:52 PM
  3. if statment question
    By Carsten in forum C++ Programming
    Replies: 3
    Last Post: 12-02-2002, 05:50 PM
  4. If statment +text
    By Zewu in forum C++ Programming
    Replies: 4
    Last Post: 01-07-2002, 04:31 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21