Decision Making and Branching statements
Normally a program executes in sequential order. To change the sequence of execution of a program one can use Decision Making and Branching statements.
Types of Decision Making and Branching statements
- if
- switch
- conditional operator
- goto
if statement :
This statement is considered as most important among Decision Making and Branching statements and used for handling simple and complex conditions.
switch statement:
This statement is used for handling choice oriented programs. If the number of choices are more than this statement is very helpful.
conditional operator : This is one line decision making statement. It is used for handling simple conditions.
goto statement : This is unconditional statement used shifting a control of execution from one part of program to another part either in backward or forward direction.
Comments
Post a Comment