You are on page 1of 2

PRACTICAL 5

PRACTICAL 5:
OBJECT: Program using Control Structures.
TOOLS: Visual Studio 2010 installed in the PC.

THEORY:
CONTROL STRUCTURES:
Control structures that enable programmers to control the order of events in their programs.
Visual Basic's sequence, selection and repetition structures are used to select and repeat various
statements and thereby execute complex algorithms. A control structure is a primary concept in
most high-level programming languages. In its simplest sense, it is a block of code. More
specifically, control structures are blocks of code that dictate the flow of control. In other words,
a control structure is a container for a series of function calls, instructions and statements.
Control structures are of two types Selection Structures and repetition structures.

TYPES OF CONTROL STRUCTURES:


Control structures are of two types
1. Selection Structures.
2. Repetition structures.

SELECTION STRUCTURES:
Selection structures or Decision making control statements are used to control the flow of a
program by checking one or more conditions or by selecting one or more conditions.

TYPES OF SELECTION STRUCTURES:


Selection structures are further sub divided into
1. If/Then Selection Structure
2. If/Then/Else Selection Structure
3. Select Case Selection Structure

PRACTICAL 5
2. REPETITION STRUCTURES / LOOP STRUCTURES:
A loop is something that goes round and round and round. If someone told you to move
your finger around in a loop, you'd know what to do immediately. In programming, loops
go round and round and round, too. In fact, they go round and round until you tell them to
stop.
Loop statements are used to execute a block of statements repeatedly. To execute a
statement 100 times repeatedly in the program it is not necessary to write a statement 100
times in the program but you simply use a Loop.

TYPES OF REPETITION STRUCTURES / LOOP STRUCTURES:


There are six types of repetition/ loop structures.
1)
2)
3)
4)
5)
6)

For / Next Loop


Do While/ Loop
Do / Loop While
Do Until / Loop
Do / Loop Until
While Loop

You might also like