Loops are used when you need to execute some code more times or until some condition is achieved.
There is two types of loops: “for” and “while”.
For loop looks like this: for( int i=0;i<10;i++){ }
This loop will execute it`s block of code 10 times and in first part we declare some variable(most of programmers call it “i” but it can be anything) in second part we set a condition and it is usually tied to a variable that we declared in first part like here, and in third part we say what we want to happen each time it`s block of code is executed and in this case we want to increment i by one so this loop says: “while i doesnt reach 10 this bloc of code will be executed and each time i will increment by one.
While loop looks like this while(condition){}
This loop executes it`s block of code as long as the condition is true.
