Professional Documents
Culture Documents
Basic Structures
Basic Structures
Basic Structures
STRUCTURES
REPORTERS:
STRUCTURES
A basic unit of programming logic
to represent information about something more
complicated than a single number, character, or Boolean
can do.
SLIDESMANIA
THREE BASIC STRUCTURES
01 | SEQUENCE 02 | SELECTION 03 | LOOP
SLIDESMANIA
SEQUENCE
start at the beginning and continue in sequential
order.
END
SELECTION
Also called a decision structure or an if-then-else
Depending on whether a condition is true or false, the decision control structure may skip the
execution of an entire block of statements or even execute one block of statements instead of
another.
SLIDESMANIA
START
EXAMPLE:
READ TEMPERATURE
TEMP
FALSE TRUE
<32?
END
LOOP
Also called repetition or iteration.
structure which allows the execution of a block of statements multiple times until when the
specified condition is met.
TYPES OF LOOP
1. WHILE LOOP 2. FOR LOOP 3.DO-WHILE LOOP
the initial value is the condition is
a condition is evaluated performed only once, then always executed after
before processing a body the condition tests and the body of a loop. It
of the loop. If a condition is compares the counter to a is also called an exit-
true then and only then the fixed value after each controlled loop.
SLIDESMANIA
EXAMPLE: N=1
ENTER A NAME
DISPLAY A NAME
yes
END
N=20
no
SLIDESMANIA
N= n-1
THANK
YOU!!
SLIDESMANIA