do for loops need to use the variable c++ 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;
}