Unconditional Control Statements

Statements that transfers control from on part of the program to another part unconditionally Different unconditional statements are goto break continue 1. goto Statement The goto statement is used for unconditional branching or transfer of the program execution to the labeled statement. The goto statement is strongly discouraged as it makes it difficult to follow the program logic, this way inducing to errors. In some (mostly rare) cases the goto statement allows to write uncluttered code, for example, when handling multiple exit points leading to the cleanup code at a…

Read More

Conditional Control Statements

Most programming languages have control flow statements (constructs) which provide some sort of control structures that serve to specify order to what has to be done to perform our program that allow variations in this sequential order: Statements may only be obeyed under certain conditions (conditionals) Statements may be obeyed repeatedly under certain conditions (loops) A group of remote statements may be obeyed (subroutines) Conditional Control Statements are divided in three types: Decision making statements Switch case control statement Loop control statements or repetitions It can actually be argued that…

Read More

Control Statements in C++

Usually a program is not a linear sequence of instructions. It may repeat code or take decisions for a given path-goal relation. Most programming languages have control flow statements (constructs) which provide some sort of control structures that serve to specify order to what has to be done to perform our program that allow variations in this sequential order.The flow of execution of statements in a program is called as control. Control statement is a statement which controls flow of execution of the program. Control statements are classified into following…

Read More