Looping Statement &
Flow Chart
Guided by-
All Teachers
Presented by –
Rahul Sahu
B.Sc.- IIIrd Year (CS)
Looping Statement:-
The Statement which is use to repeat the single or block
of statement up to given condition is known as looping
statement.
Type of looping statement:- looping statement is
divided in two parts-
i. Entry control loop
ii. Exit control loop
Entry Control Loop:-
The looping statement which check the condition first
and than execute block of statement is known as Entry
control loop.
It is known as Entry control loop because it check
condition in Entry level of loop. If condition is true the
body of loop is executed and if condition is false the
body of loop is not executed.
Ex:- for and while.
Exit Control Loop:-
This looping statement is executed body of loop first (at
least one time) and than condition is checked because
the condition is checked at the time of exit this looping
statement is known as Exit control loop.
Ex:- do while .
While loop:-
The simplest entry control loop which can first check
condition than execute body of loop if condition is true.
Syntax:-
while(condition)
{
-----------------
body of loop;
-----------------
increment / decrement operator of a counter
variable;
}
Example:-
#include<stdio.h>
void main()
{
int a,b,c;
printf(“n Enter the no. to print table”); Output:-
scanf(“%d”,&a);
b=1;
while(b<=10)
{
c=a*b;
printf(“n %d x %d = %d”,a,b,c);
b++;
}
getch();
}
For loop:-
For is composite control loop in which all the looping
part is written single line.
Syntax:-
for(initialization ; condition; increment)
{
-------------------
body of loop;
-------------------
}
Example:-
#include<stdio.h>
void main()
{
int a,b,c;
printf(“n Enter the no. to print table”); Output:-
scanf(“%d”,&a);
for(b=1;b<=10;b++)
{
c=a*b;
printf(“n %d x %d = %d”,a,b,c);
}
getch();
}
Do While Loop:-
do while is exit control loop in which body of loop
executed first ( at least one time) by do statement and
than condition is checked by while statement. If
condition is true the process is repeated otherwise next
part of program is executed.
Syntax:-
do
{
-----------------
Block of statement;
------------------
}while(condition);
goto statement:-
It is a jumping statement use to jump the control of
program from one part to another specific part.
Syntax:-
goto label;
Types of goto statement:-
1. Forward jump (label declare to below of goto )
2. Backward jump (label declare to above of goto)
Flow Chart:-
A flow chart is essentially a diagram or picture which
defines the procedure how to solve the problem. A flow
chart show the order of operations. It also show the
relationship between the sections of the program. Flow
chart are independent of a particular computer or
computer language.
Some Basic Symbol For
Flow Chart:-
Start / End In page break
Input / Output Off page break
Processing
Decision
Flow of Process
Example:-
Print table
False
True
Start
Enter no. a
b=1
Is
b<=10
c= a * b
Print a x b =c
b++
Stop
Thank you

Looping Statement And Flow Chart

  • 1.
    Looping Statement & FlowChart Guided by- All Teachers Presented by – Rahul Sahu B.Sc.- IIIrd Year (CS)
  • 2.
    Looping Statement:- The Statementwhich is use to repeat the single or block of statement up to given condition is known as looping statement. Type of looping statement:- looping statement is divided in two parts- i. Entry control loop ii. Exit control loop
  • 3.
    Entry Control Loop:- Thelooping statement which check the condition first and than execute block of statement is known as Entry control loop. It is known as Entry control loop because it check condition in Entry level of loop. If condition is true the body of loop is executed and if condition is false the body of loop is not executed. Ex:- for and while.
  • 4.
    Exit Control Loop:- Thislooping statement is executed body of loop first (at least one time) and than condition is checked because the condition is checked at the time of exit this looping statement is known as Exit control loop. Ex:- do while .
  • 5.
    While loop:- The simplestentry control loop which can first check condition than execute body of loop if condition is true. Syntax:- while(condition) { ----------------- body of loop; ----------------- increment / decrement operator of a counter variable; }
  • 6.
    Example:- #include<stdio.h> void main() { int a,b,c; printf(“nEnter the no. to print table”); Output:- scanf(“%d”,&a); b=1; while(b<=10) { c=a*b; printf(“n %d x %d = %d”,a,b,c); b++; } getch(); }
  • 7.
    For loop:- For iscomposite control loop in which all the looping part is written single line. Syntax:- for(initialization ; condition; increment) { ------------------- body of loop; ------------------- }
  • 8.
    Example:- #include<stdio.h> void main() { int a,b,c; printf(“nEnter the no. to print table”); Output:- scanf(“%d”,&a); for(b=1;b<=10;b++) { c=a*b; printf(“n %d x %d = %d”,a,b,c); } getch(); }
  • 9.
    Do While Loop:- dowhile is exit control loop in which body of loop executed first ( at least one time) by do statement and than condition is checked by while statement. If condition is true the process is repeated otherwise next part of program is executed. Syntax:- do { ----------------- Block of statement; ------------------ }while(condition);
  • 10.
    goto statement:- It isa jumping statement use to jump the control of program from one part to another specific part. Syntax:- goto label; Types of goto statement:- 1. Forward jump (label declare to below of goto ) 2. Backward jump (label declare to above of goto)
  • 11.
    Flow Chart:- A flowchart is essentially a diagram or picture which defines the procedure how to solve the problem. A flow chart show the order of operations. It also show the relationship between the sections of the program. Flow chart are independent of a particular computer or computer language.
  • 12.
    Some Basic SymbolFor Flow Chart:- Start / End In page break Input / Output Off page break Processing Decision Flow of Process
  • 13.
    Example:- Print table False True Start Enter no.a b=1 Is b<=10 c= a * b Print a x b =c b++ Stop
  • 14.