Loops In C Program
Typing Speed: 24

Ismail
Ismailpk456@gmail.com
Ismail Ismu
Ismail Ismu
in.linkedin.com/in/profilena
me
8086303494
Loop
 There may be a situation, when you need to execute a block
of code several number of times. In general, statements are
executed sequentially: The first statement in a function is
executed first, followed by the second, and so on.

 Programming languages provide various control structures
that allow for more complicated execution paths.
 A loop statement allows us to execute a statement or group
of statements multiple times and following is the general form
of a loop statement in most of the programming languages
Loops In C
Entry control loop
 for loop
 while loop

Exit control loop
 do while loop
for loop
• The traditional for loop found in C requires 3
parts:
1) Initialization
2) Condition
3) Increment
While loop
• A while loop statement in C programming
language repeatedly executes a target
statement as long as a given condition is true.
Do while loop
• which test the loop condition at the top of the
loop, the do...while loop in C programming
language checks its condition at the bottom of
the loop.
• A do...while loop is similar to a while loop,
except that a do...while loop is guaranteed to
execute at least one time
For loop
Syntax
for ( variable initialization; condition; variable update )
{
Code to execute while the condition is true
}

Example
for (j=0;j<5 ;j++)
{
printf(“Hai”);
}
While loop
Syntax
while (expression)
{
// execute statements
}

Example
int i = 10;
while ( i > 0 )
{
printf("Hello %dn", i );
i = i -1;
}
do While loop
Syntax
do
{
statement(s);
}
while( condition );

Example
int a = 1;
Do
{
printf("value of a: %dn", a);
a = a + 1;
}
while( a <= 10 );
If this presentation helped you, please visit our
page facebook.com/baabtra and like it.

Thanks in advance.
www.baabtra.com | www.massbaab.com |www.baabte.com
Contact Us
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550

Start up Village
Eranakulam,
Kerala, India.
Email: info@baabtra.com

NC Complex, Near Bus Stand
Mukkam, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
THE END

Loops in c

  • 2.
    Loops In CProgram Typing Speed: 24 Ismail Ismailpk456@gmail.com Ismail Ismu Ismail Ismu in.linkedin.com/in/profilena me 8086303494
  • 3.
    Loop  There maybe a situation, when you need to execute a block of code several number of times. In general, statements are executed sequentially: The first statement in a function is executed first, followed by the second, and so on.  Programming languages provide various control structures that allow for more complicated execution paths.  A loop statement allows us to execute a statement or group of statements multiple times and following is the general form of a loop statement in most of the programming languages
  • 4.
    Loops In C Entrycontrol loop  for loop  while loop Exit control loop  do while loop
  • 5.
    for loop • Thetraditional for loop found in C requires 3 parts: 1) Initialization 2) Condition 3) Increment
  • 6.
    While loop • Awhile loop statement in C programming language repeatedly executes a target statement as long as a given condition is true.
  • 7.
    Do while loop •which test the loop condition at the top of the loop, the do...while loop in C programming language checks its condition at the bottom of the loop. • A do...while loop is similar to a while loop, except that a do...while loop is guaranteed to execute at least one time
  • 8.
    For loop Syntax for (variable initialization; condition; variable update ) { Code to execute while the condition is true } Example for (j=0;j<5 ;j++) { printf(“Hai”); }
  • 9.
    While loop Syntax while (expression) { //execute statements } Example int i = 10; while ( i > 0 ) { printf("Hello %dn", i ); i = i -1; }
  • 10.
    do While loop Syntax do { statement(s); } while(condition ); Example int a = 1; Do { printf("value of a: %dn", a); a = a + 1; } while( a <= 10 );
  • 11.
    If this presentationhelped you, please visit our page facebook.com/baabtra and like it. Thanks in advance. www.baabtra.com | www.massbaab.com |www.baabte.com
  • 12.
    Contact Us Emarald Mall(Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550
  • 13.