Control structure is a structure of statements in programming that allows the programmer to control the flow of a program.
Control structure can be divided into sequence, selection and repetition control structures.
SEQUENCE CONTROL
Sequence control refers to the linear execution of codes within a program. In sequence control, the statements are executed one by one in consecutive order.
In sequence control, the statements are executed one by one in consecutive order.
SELECTION CONTROL
There are times when you want your program to make a decision based on the situation given.
For example, a program that stores student’s marks may respond differently to different marks.
Or maybe a simple mathematical program will display its result as odd or even, based on the result.
Selection control enables the programmer to assign different events for different situations.
An example of selection control is “If...Then...Else” statement. The basic pseudo code for “If...Then...Else” statement is as follows.
DIFFERENTIATE BETWEEN SELECTION CONTROL AND SEQUENCE CONTROL
__________________________________________________________________________________
Others Lesson : | click lesson to view |
- Define Program and Programming Language
- Level And Generation Of Programming Language
- Programming Language Approach
- Translator
- Basic Element In Programming : Constant And Variable
- Basic Element In Programming : Data Type
- Basic Element In Programming : Mathematical and Logical
- Basic Element In Programming : Sequence And Control
- Pseudo-code And Flowchart
0 comments:
Post a Comment