Loops are simply used to reduce the number of lines in the code, making it less complex.
Suppose we want to write Hello 20 times. We can just add a loop in such cases and reduce the no of lines and make the code look short and sweet for better understanding.
3 types of the loop:
1. For
2. While
3. Do-while