Fringetos
0
Q:

how to make a Loop in c++

for (int i = 0; i < 5; i++) 
{
  cout << i << "\n";
}
6
// There are 2 loops in ++ :

while(1==1){  }
//    |  |   | 
//     |   What happens while condition is true
//     |    
//    the condition


//for loop

for (int i; i < 10; i++){    }
//   |___|  |___|   |_|  |__|
//     |      |      |     | 
//     |      |      |     what happens when conditons is true
//     |      |     what happens each time loop is reapeted
//     |      The condition in wich the loop is true
//     a variable declaratoin
1
for (int i; i < 10; i++)
{
  cout << i << "\n";
}
0
for ( init; condition; increment ) {
   statement(s);
}
0

New to Communities?

Join the community