A loop is a sequence of instructions which is continually repeated . This sequence is repeated until a certain condition is reached.
When sequence of instructions reach on condition then loop stops running .
LOOPs programs always terminate . Therefore, the set of functions computable by LOOPs-programs is a proper subset of computable functions (and thus a subset of the computable by WHILE and GOTO program functions).
Woking and usage
It is used for shorting the codes such as you can use a simple loop to shortning a big size if statement . We can understand this with a simple example . If statement is used to compare or match conditions . PHP if statment example .
A tex tbox is created in program . In this text box user can type any digit within 0-9 . when we execute this input text ,program get value of this text box and add numbers one by one till than result reach on number 10 .
To get value and compare and add number we can use multiple if statements . But with it we create a large 12-15 lines code . At this time Loops are very helpful to make a short and powerful code