C loops and Conditional statements | Q - 9

Last Updated :
Discuss
Comments

Can you place a function call inside the initialization part of the for loop?

C
for (printf("Init\n"); i < 3; i++) {
    printf("Body\n");


No, only variable declarations are allowed

Only arithmetic expressions are allowed

Causes a runtime error

Yes, function calls are valid

Tags:
Share your thoughts in the comments