Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

For Loop Conditions in C

  1. Oct 18, 2011 #1
    i know that it is possible to have multiple conditions in a for loop. but is it seperated by a comma or would it be seperated by && like in an if statement?

    Thanks
     
  2. jcsd
  3. Oct 18, 2011 #2

    rcgldr

    User Avatar
    Homework Helper

    You'll need to combine conditions with && or ||. Just in case you didn't know, the binary mathematical operators, & and | are lower precedent than comparson or logical operators, use parenthesis to avoid issues.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: For Loop Conditions in C
  1. C++ and for loops (Replies: 3)

  2. C while loop issue (Replies: 26)

  3. How to Loop this C++ (Replies: 2)

  4. For loop in c (Replies: 3)

  5. Loop in c (Replies: 1)

Loading...