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#include <iostream>
2
3using namespace std;
4
5int main(){
6
7 int i; //initialize integer
8 //i starts at 0 and stops at 4, as 5 is not < 5
9 for (i = 0; i < 5; i++){ //i++ means add 1 to i each iteration
10 cout << "number " + i << endl; //print 5 times
11 }
12 return 0;
13}
14//output:
15/*
16number 0
17number 1
18number 2
19number 3
20number 4
21*/
1for (/* init var */;/* break condition */;/* mathmatic operation */) {
2 // do something
3}