DIFFERENT WAYS TO WRITE FOR LOOP IN CPP code example
Example 1: for loop in c++
for ( int i = 0; i < 5; i++)
{
cout << "Hello" << endl;
}
// prints hello 5 times.
Example 2: for loop in c++
for (int i = 0; i < 10; i++)
{
cout << i << endl;
}