Professional Documents
Culture Documents
Practical 5 of
Practical 5 of
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.
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.
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.