HOME C C++ PYTHON JAVA HTML CSS JAVASCRIPT BOOTSTRAP JQUERY REACT PHP SQL AJAX JSON DATA SCIENCE AI

For Loop

Definition:

A For loop is a repetition control structure that allows us to write a loop that is executed a specific number of times. The loop enables us to perform n number of steps together in one line.



Example
    //C++ program to demostrate for loop
    #include<iostream>
    using namespace std;
    int main()
    {
        for(int i=1;i<=5;i++)
        {
            cout<<"Hello World\n";
        }
                
    }
            

Output:

Hello World

Hello World

Hello World

Hello World

Hello World