Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 6

TECHNICAL UNIVERSITY OF MOMBASA

Control Structures
in
C Language

1
Introduction to Control Structures

Flow of Control: the order in which statements are


executed.

• Unless otherwise stated, the order is linear (sequential)


– one statement after another in sequence.

• This means that when a statement has been executed,


control is passed over to the next statement

2
Introduction to Control Structures

Control Structure: this is a mechanism that departs


from the default sequential execution

• In order to alter the flow to be non-sequential, we use


a control structure

• If a program uses control structures, statements may


be executed sequentially, selectively or iteratively

3
Introduction to Control Structures

Why control structures?

Some programming statements (control statements)


allows us to:

• Decide whether or not to execute a particular


statement (selection/decision statement)
• Execute a statement over and over again
(iterative/loop/repetitive statement)

4
Introduction to Control Structures

Types of control structures

There are three types of control structures:

1. Sequential
2. Decision/selection
3. Repetitive /loop/iterative

We shall look each of this in details in our next video

5
THANK YOU

You might also like