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.
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook