Lesson 02
Iteration/Looping
in
C Programming
Pijushkanti Panigrahi
, What is Looping ?
• The looping can be defined as repeating the same
process multiple times until a specific condition
satisfies. It is known as iteration also. There are
three types of loops used in the C language. In
this part of the tutorial, we are going to learn all
the aspects of C loops..
2
, Why looping?
• The looping simplifies the complex problems into the
easy ones.
• It enables to alter the flow of the program so that
instead of writing the same code again and again, we
can execute the same code for a finite number of
times.
For example, if we need to print ‘UNIVERSITY OF
CALCUTTA’ 10-times then, instead of using the printf
statement 10 times, we can use printf once inside a
loop which runs up to 10 iterations.
3
•
Iteration/Looping
in
C Programming
Pijushkanti Panigrahi
, What is Looping ?
• The looping can be defined as repeating the same
process multiple times until a specific condition
satisfies. It is known as iteration also. There are
three types of loops used in the C language. In
this part of the tutorial, we are going to learn all
the aspects of C loops..
2
, Why looping?
• The looping simplifies the complex problems into the
easy ones.
• It enables to alter the flow of the program so that
instead of writing the same code again and again, we
can execute the same code for a finite number of
times.
For example, if we need to print ‘UNIVERSITY OF
CALCUTTA’ 10-times then, instead of using the printf
statement 10 times, we can use printf once inside a
loop which runs up to 10 iterations.
3
•