hatano yui
21
Q:

for loops in cpp

for ( int i = 0; i < 5; i++)
{
  cout << "Hello" << endl;
}
// prints hello 5 times. 
3
for(int i=0; i<=limit; i++)
{
	//statement
}
5

for (int i = 0; i <= 10; i = i + 2) {
    cout << i << "\n";
}
  
5

  for (int i = 0; i < 5; i++) {
  cout << i << "\n";
}

  
1
for (int i = 0; i < 10; i++)
    {
        cout << i << endl;
    }
3
#include <iostream>
#define FOR(i,a) for (int i = 0; i < a; i++)

FOR(i, 3) cout << i << endl;
1
for ( init; condition; increment ) {
   statement(s);
}
0

New to Communities?

Join the community