Computer Science Canada

how can I show 3 cases in one if statement

Author:  lindsay [ Tue Oct 23, 2007 2:49 pm ]
Post subject:  how can I show 3 cases in one if statement

how can I show 3 cases in one if statement??????
example: if a and b and c are bigger than 10 and smaller than 100
???
any help will be appreciated Smile Smile Smile

Author:  OneOffDriveByPoster [ Tue Oct 23, 2007 3:04 pm ]
Post subject:  Re: how can I show 3 cases in one if statement

The operators you are looking for is && and ||.

c:
if (a > 10 && a < 100) {
    /* a is in range (10, 100) */
}

Author:  lindsay [ Tue Oct 23, 2007 3:06 pm ]
Post subject:  RE:how can I show 3 cases in one if statement

thanks a lot


: