Introduction to C
Data Types in C
Operators in C
Hello World Program
Loops in C
Single Dimensional Array
Two Dimesnional Arrays
Array Example Programs
Before discussing various loops in 'C', it is necessary to understand about loop, what exactly it is. We use loop
when we have to repeat a block of code. For many times, it is required to execute the same code a number of times for some cases. Then we take the help of loop.
There are three types of loop:-
There are two keywords which are important in loop. So, before studying loops in deep, lets see these two keywords.
They are:- 1. break 2. continue
We use break to terminate the loop. In other words, we can say that it is useful to get exit from a loop under some circumstances. This will be more clear in using loops in next chapters.
Continue is a keyword that controls the flow of loops. Sippose we are executing a loop and hit a continue statement, the loop will stop its current iteration, update itself (in case of for loops) and begin to execute again from the top.