Thread: Unless statement

  1. #1
    Registered User
    Join Date
    Apr 2009
    Posts
    6

    Unless statement

    Hi I am new at programming. I ve a problem how to say unless in C.
    For example:

    if(TRUE)&& Unless(TRUE)

    note:
    I CANNOT SAY
    if(TRUE)&& IF(FALSE)

    i WOULD APPRECIATE ANY HELP

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Can you describe what you are trying to do in a different way, as I can't make any sense of what you are describing.

    Or perhaps you are just confused as to the combination using and/or operators?

    A typical example would be:
    Code:
    leapyear = (year % 4 == 0) && !(year % 100 == 0) || (year % 400 == 0);
    That is, it's a leap year if the year is divisible by 4, and not divisible by 100, except (unless) it's divisible by 400. So 2000 is a leap-year, 1900 is not, 1904 and 2004 are both leap years, to give some examples.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Apr 2009
    Posts
    6

    Thanks for help

    Yes its ok thanks a lot

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Usefulness of the "else if" statement
    By gn17 in forum C Programming
    Replies: 7
    Last Post: 08-12-2007, 05:19 AM
  2. Meaning of this statement?
    By @nthony in forum C Programming
    Replies: 7
    Last Post: 07-16-2006, 02:57 AM
  3. If Else statement problem
    By doofusboy in forum C Programming
    Replies: 2
    Last Post: 11-09-2005, 07:18 AM
  4. string & if statement
    By Curacao in forum C++ Programming
    Replies: 4
    Last Post: 05-02-2003, 09:56 PM
  5. Uh-oh! I am having a major switch problem!
    By goodn in forum C Programming
    Replies: 4
    Last Post: 11-01-2001, 04:49 PM