What is control instruction?
As the name suggests the 'Control Instructions' enable us to specify the order in which the various instructions in a program are to be executed by the computer. In other words, the control instructions determine the 'flow of control' in a program.
Program is a set of instructions. We know that each instruction of the program is executed by the processor. The processor executes instructions one by one. Whatever we write in our program is executed in the same order as they appear in the program. We can say processor executes instructions in a sequential manner. At a particular instant, the processor is executing some line of code, we say control of the processor is on that line. Processor’s control moves from one line to another. This movement of control is known as the flow of the program.
As the name suggests the 'Control Instructions' enable us to specify the order in which the various instructions in a program are to be executed by the computer. In other words, the control instructions determine the 'flow of control' in a program.
Program is a set of instructions. We know that each instruction of the program is executed by the processor. The processor executes instructions one by one. Whatever we write in our program is executed in the same order as they appear in the program. We can say processor executes instructions in a sequential manner. At a particular instant, the processor is executing some line of code, we say control of the processor is on that line. Processor’s control moves from one line to another. This movement of control is known as the flow of the program.
There are four types of control instructions:
- Decision control instruction
- Iterative control instruction
- Switch case-control instruction
- goto instruction
Add caption |
No comments:
Post a Comment