for(3; any condition; increment/decrement) here, how does 3 affect the code, is it allowed? | SoloLearn: Learn to code for FREE!

+2

for(3; any condition; increment/decrement) here, how does 3 affect the code, is it allowed?

5/20/2020 9:01:20 AM

Manish Suthar

2 Answers

New Answer

+5

Syntax for (statement 1; statement 2; statement 3) { // code block to be executed } Statement 1 is executed (one time) before the execution of the code block. Statement 2 defines the condition for executing the code block. Statement 3 is executed (every time) after the code block has been executed. You can omit statement 1

+1

for(initialization/ Declaration; Condition; Increment/Decrement) { // for body... }