The following code runs without giving any errors or warnings
#include<stdio.h>
int main(){
int i, j;
int p = 0, q = 2;
for(i = 0, j = 0; i < p, j < q; i++, j++){
printf("HelloWorld\n");
}
return 0;
}
However, the book Let Us C(Yashwant Kanetkar) says that only one expression is allowed in the test expression of a for loop.(see pg 115 of the book).
I am not sure of the standard. Are multiple expressions allowed in the test expression of a for loop ?
EDIT : I surely can join the two expressions but I was dumbstruck when I found the above code on this website . My question is that is this valid C code or not?