Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 how can I show 3 cases in one if statement
Index -> Programming, C -> C Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
lindsay




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
OneOffDriveByPoster




PostPosted: 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) */
}
lindsay




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

thanks a lot
Display posts from previous:   
   Index -> Programming, C -> C Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: