Thursday, April 18, 2019

for loop multiple conditions

what is the right?
1. for (i = 0, j = 0; i < loop, j < loop2; i++, j++)
2. for (i = 0, j = 0; (i < loop) && (j < loop2); i++, j++)

The answers are
Are multiple conditions allowed in a for loop?
GeeksforGeeks: Output of C Program | Set 22, question 2

for example
i = 1, 2; is same as i = 2;

No comments: