way to for loop in c++ example
Example 1: how to make a Loop in c++
for (int i; i < 10; i++)
{
cout << i << "\n";
}
Example 2: for loop in c++
for ( int i = 0; i < 5; i++)
{
cout << "Hello" << endl;
}
// prints hello 5 times.
for (int i; i < 10; i++)
{
cout << i << "\n";
}
for ( int i = 0; i < 5; i++)
{
cout << "Hello" << endl;
}
// prints hello 5 times.