The purpose of a control structure is to change the sequence of control in a program. In the absence of a control structure, the program flows in a linear way, executing line by line. The presence of a control structure changes the program flow by choosing the right path based on a decision. The common control structures can be characterised as follows:
Decision Control Structures
Loop Control Structures
Case Control Structure
Jumping Control Structure
Decision Control Structures
We can have different forms of decision control structures as follows:
if
if..else
if..else if..else
nested if