Loops and beginning of c programming

Loop is a statement which allows repetition of execution of statements subject to fulfillment of a condition.

It contains three parts
  1. Initialization: Contol variable is assigned a value.
  2. Condition testing: The condition testing part of the loop evaluate a condition and the result of this evaluation decides if the loop execute or will be skipped.
  3. Increment: The control variable is set from the initial value to its final value.
There are three loops in c I know

1.while loop:The example will make you understand
 Output:





2.for loop

Comments

Post a Comment

Feel free to leave a comment...

Popular posts from this blog

C++ programming toll plaza simulation program

C++ program to give you hug(pun intended)