For Loop Conditions in C: How Do You Combine Multiple Conditions?

  • Thread starter Thread starter Peter P.
  • Start date Start date
  • Tags Tags
    Conditions Loop
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 2K views
Peter P.
Messages
23
Reaction score
0
i know that it is possible to have multiple conditions in a for loop. but is it separated by a comma or would it be separated by && like in an if statement?

Thanks
 
Physics news on Phys.org
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.