2. While () loop in C
• while loop has one control condition, and
executes as long the condition is true.
• The condition of the loop is tested before the
body of the loop is executed.
• It is also called an entry-controlled loop.
3. Syntax of while() Loop
While (condition)
{
statement(s);
Incrementation;
}
11. do while() Loop in C
• do while loops are very similar to the while
loops.
• But it always executes the code block at least
once and furthermore as long as the condition
remains true.
• This is an exit-controlled loop.
12. Syntax of do while() Loop
do
{
statement(s);
}
while( condition );
25. switch Statement in C
• The switch case statement is used when we
have multiple options and we need to
perform a different task for each option.
26. Syntax of switch Statement
switch(variable)
{
case 1: //execute your code
break;
case n: //execute your code
break;
default: //execute your code
break;
}