Coupon Accepted Successfully!



  1. Decision-making statements in a programming language help the programmer to transfer the control from one part of the program to another part.
  2. C++ language supports the following decision-making statements: if statement, if-else statement, nested if-else statements, else-if ladder, switch case statement, break statement, and the default keyword.
  3. C++ uses the keyword if to execute a set of command lines or a command line when the logical condition is true.
  4. Multiple ifs are used in C++ to tackle alternate decisions.
  5. In the if–else statement, if the expression/condition is true, the body of the if statement is executed; otherwise, the body of the else statement is executed. The else keyword is used when the expression is not true.
  6. In nested if-else statements, a number of logical conditions are tested for taking decisions. Here, the if keyword followed by an expression is evaluated. If it is true, the compiler executes the block following the if condition; otherwise, it skips this block and executes the else block. It uses the if statement nested inside an if-else statement, which is nested inside another if-else statement. This kind of nesting can be limitless.
  7. A common programming construct is the else-if ladder, sometimes called the if-else-if staircase because of its appearance. In the program one can write a ladder of else-if. The program goes down the ladder of else-if, in anticipation of one of the expressions being true.
  8. C/C++ has four statements that perform an unconditional control transfer. They are return, goto, break and continue. Of these, return is used only in functions. The goto and return may be used anywhere in the program but continue and break statements may be used only in conjunction with a loop statement. The break is used most frequently in switch case.
  9. The goto statement does not require any condition. This statement passes control anywhere in the program without considering any condition.
  10. The break statement allows the programmer to terminate the loop. It is widely used in the switch case where it is used to avoid the flow of control from one “case”
  11. The continue statement works somewhat like the break statement. Instead of forcing the control to the end of the loop (as it is in case of break), the continue case causes the control to pass on to the beginning of the block/loop. It is useful in a programming situation where it is required that particular iterations occur only up to some extent or when some part of the code has to be neglected.
  12. The switch statement is a multi-way branch statement and an alternative to if-else-if ladder in many situations.
  13. C/C++ supports the nesting of switch case. The inner switch can be part of an outer switch. The inner and the outer switch case constants may be the same. No conflict arises even if they are same.

Test Your Skills Now!
Take a Quiz now
Reviewer Name