An if statement can be followed by an optional else statement, which executes when the Boolean expression is false. An if statement can be followed by an optional else if...else statement, which is very useful to test various conditions using single if...else if statement.
It is always legal in C programming to nest if-else statements, which means you can use one if or else if statement inside another if or else if statement(s).
A switch statement allows a variable to be tested for equality against a list of values. Each value is called a case, and the variable being switched on is checked for each switch case.
A while loop in C programming repeatedly executes a target statement as long as a given condition is true.
Unlike for and while loops, which test the loop condition at the top of the loop, the do...while loop in C programming checks its condition at the bottom of the loop. A do...while loop is similar to a while loop, except the fact that it is guaranteed to execute at least one time.
No comments:
Post a Comment