for statement in C++
The for statement or for loop is useful while executing a statement multiple number of times. The for loop is the most commonly used statement in C++. This loop consists of three expression: The first expression is used to initialize the index value The second expression is used to check whether or not the loop is to be continued again The third expression is used to change the index value for further iteration The general form of for statement is: for(expression 1; expression 2; expression 3) statement; In other words, for(initial condition; test condition; incrementer or decrementer) { statement1; statement2; ….. ….. } Where, expression 1 is the initialization of the expression or the condition called an index expression 2 is the condition checked. As long as the given expression is true the loop statement will be repeated expression 3 is the incrementer or decrementer to change the index value...