2 ms·
It works without the additional braces. Consider this: for (i=0;i<imax;i++) printf("%d\n", i); You can omit the braces if the body of the loop is
by Sir_Cmpwn 11y ago
It works without the additional braces. Consider this:
for (i=0;i<imax;i++)
printf("%d\n", i);
You can omit the braces if the body of the loop is a single block, just like an if statement. You can also do this:
if (a == b)
if (b == c)
{
do_thing();
}
Same deal with the for loop. The nested loop is a single block.