for(3; any condition; increment/decrement) here, how does 3 affect the code, is it allowed? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 3

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

20th May 2020, 9:01 AM
Manish Suthar
Manish Suthar - avatar
2 Respostas
+ 7
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
20th May 2020, 9:07 AM
Toan Phan
+ 3
for(initialization/ Declaration; Condition; Increment/Decrement) { // for body... }
20th May 2020, 9:11 AM
Shahghasi Adil
Shahghasi Adil - avatar