Which are selection statements? explain with example. in c?
Answers
Answer:
Use of if selection statements is among the simplest ways to manage program flow. This statement can determine whether a block of code is to be run or not. The following could be the syntax for an if selection statement in C: If(cond) statement(s); to be carried out if the given condition is met.
Choose statements in the C language using examples: if () Statements for C Language Selection#
Switch () statements, if selection statements, and the if ()... else syntax
if ()... combining at least two if (...)...else sentences using if selection statements.
If()..else Nested vs. Ladder If()..else.
Example:
Write "a is greater than 1" if a > 1; else, write "a is not larger than 1"; When the block covered by the if or else condition just contains one sentence, the braces can be omitted in the same way as the if statement (but doing so is not recommended as it can easily introduce problems involuntarily).
#SPJ3
https://brainly.in/question/15195109