1//'i' can be any number
2//Can be any comparison operater
3//can be any number compared
4//can be any mathmatic operater
5
6for (int i = 0; i<100; i++){
7//Do thing
8}
9
10//more info on operaters
11//https://www.w3schools.com/cpp/cpp_operators.asp
1#include <iostream>
2using namespace std;
3
4int main()
5{
6 for (int i = 0; i < 20; i++)
7 {
8 cout << i << endl;
9 }
10 //prints the number (i)
11}
1
2
3
4for (int i = 0; i < 10; i++){
5 //Do something as long as i is less than 10,
6 //In that case it will loop 10 times
7 //use break; to restart the loop whenever you want to cancel the loops.
8 cout << i;
9
10 //at the end, remember i will be increased by 1.
11}
12
13//output 0123456789