Repetition in C Language (For)
- welly widianto
- Oct 13, 2018
- 1 min read
Repetition is one or more instruction repeated for certain amount of time
Repetition or looping operation:
-For
-While
-Do while
But for now i will discuss about For
The syntax ( For) :

or

exp 1: Initialization
exp2:Conditional
exp3:Increment or decrement
exp1,exp2,exp3 are optional
exp 1 and exp 3 can consist of several expression separated by comma
ex:

Flow chart of FOR statement :

Infinite Loop
Loop with no stop condition can use “for-loop” by removing all parameters (exp1, exp2, exp3). To end the loop use break.
Nested Loop
Loop in a loop. The repetition operation will start from the inner side loop.

Comments