| Previous | Home | Next |
C language provides 2 types of control statements
- Branching Statements
- Looping Statements
In branching statement what action is to be performed is decided.
If Statements :
if (expression)
statement;
/****************************/
if (expression)
{
//block of statements;
}
/****************************/
if (expression)
{
//block of statements;
}
else if(expression)
{
//block of statements;
}
else
{
//block of statements;
}
Switch case statements:
switch( expression )
{
[case constant-expression1: statements1;]
[case constant-expression2: statements2;]
[case constant-expression3: statements3;]
[default: statements4;]
}
| Previous | Home | Next |