name all the decisions of control statements
Answers
Answered by
2
If statement: The statements inside if body executes only when the condition defined by if statement is
true. If the condition is false then compiler skips the statement
enclosed in if’s body. We can have any number of if statements in a C
program.
If-else statement: In this decision control statement, we have two block of statements. If condition results true then if block gets executed else statements inside else block executes. else cannot exist without if statement. In this tutorial, I have covered else-if statements as well.
Switch-case statement: This
is very useful when we need to evaluate multiple conditions. The switch
block defines an expression (or condition) and case has a block of
statements, based on the result of expression, corresponding case block
gets executed. A switch can have any number of cases, however there
should be only one default handler.
Similar questions