is it necessary to have all 3 expressions in for loop?
Answers
Answered by
1
Answer:
All these components are optional. In fact, to write an infinite loop, you omit all three expressions: for ( ; ; ) { //infinite loop ... } ... If the variable that controls a for loop is not needed outside of the loop, it's best to declare the variable in the initialization expression.
Answered by
2
Answer:
All these components are optional. In fact, to write an infinite loop, you omit all three expressions: for ( ; ; ) { //infinite loop ... } ... If the variable that controls a for loop is not needed outside of the loop, it's best to declare the variable in the initialization expression.
Similar questions