What is Loop?
Any Repeated task more than one time that is called Loop. In a loop structure, the loop asks a question. If the answer requires action, it is executed. Using loops in computer programs simplifies rather optimizes the process of coding.
For Loop :- The for is frequently used usullay where the loop will be traversed a fixed numbers of times. A loop variable is used to control the loop.
Example.
Output
When the above program is executed, it produces the following result −
![](https://miro.medium.com/max/367/1*zyiMSvDkHH8gXQn_uyerjQ.png)