C++ For Loop

C++ For Loop


C++ For Loop

The for loop is used to execute a statement or set of statements repeatedly for a specific numbers of times.

The Syntax of for loop is as follows:

for (initialization; condition; update) {

      // loop statement

}

Example :

Output :