What is Loop?
Loop is a statement to be repeated. A loop is a program which consist of two segments,
a) Body of the Loop- Consist how the loop will run.
b) Control Statement- The control statement consists of certain conditions which are checked during execution and depending on the condition with in the body of Loop.
body of loop
Now we will print 0-9 with for For loop………….
for ( x = 0; x < 10; x++ ) /* The loop goes while x < 10, and x increases by one every loop*/
/* Keep in mind that the loop condition checks
the conditional statement before it loops again.
consequently, when x equals 10 the loop breaks.
x is updated before the condition is checked. */
printf( “%d\n”, x );
Output:0 to 9
——————– Thanks Everyone