Results 1 to 3 of 3

Thread: Multiple conditions in while loop

  1. #1
    Join Date
    Feb 2009
    Posts
    23
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Multiple conditions in while loop

    edit: i've made a mistake, i don't need a loop like this. But if i need one, is it correct to use an extra () like this ?
    Code:
    ...
    while((a<1||a>10)&&b==0){
    ...
    }
    ...
    Last edited by NDK; 02-04-2009 at 10:29 AM.

  2. #2
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    This is correct.

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Yes, but I suggest adding in spaces for readability purposes. That kind of looks like line noise.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •