Write names of conditional control statements?
Answers
Answered by
2
Hi,
Answer:
Conditional control statements:
➖➖➖➖➖➖➖➖➖➖➖
Conditional control statements executes a set or sequence statements on a condition check.
few examples of conditional control statements
1) If
2) If-else
3) Switch
1) If Statement:
➖➖➖➖➖➖
syntax:
******************************************
if (text expression)
{
sequence of statements;
}
*******************************************
**compile the sequence of statements if text expression true
2) If-else Statement:
➖➖➖➖➖➖➖
Syntax:
**************************************************
if (text expression)
{
sequence of statements;
}
else
{
sequence of statements;
}
******************************************************
** On text expression true first part of programs executes otherwise else part executes.
3) Switch Statement:
➖➖➖➖➖➖➖➖
Syntax:
***************************************************
switch (n)
{
case constant1:
statements to be executes if n is equal to constant1;
break;
case constant2:
statement be executed if n is equal to constant2;
break;
. . . default: // statements be executed if n doesn't match any constant
}
***********************************************
** if there are more than two conditions ,then switch statement is used.
Hope it helps you.
Answer:
Conditional control statements:
➖➖➖➖➖➖➖➖➖➖➖
Conditional control statements executes a set or sequence statements on a condition check.
few examples of conditional control statements
1) If
2) If-else
3) Switch
1) If Statement:
➖➖➖➖➖➖
syntax:
******************************************
if (text expression)
{
sequence of statements;
}
*******************************************
**compile the sequence of statements if text expression true
2) If-else Statement:
➖➖➖➖➖➖➖
Syntax:
**************************************************
if (text expression)
{
sequence of statements;
}
else
{
sequence of statements;
}
******************************************************
** On text expression true first part of programs executes otherwise else part executes.
3) Switch Statement:
➖➖➖➖➖➖➖➖
Syntax:
***************************************************
switch (n)
{
case constant1:
statements to be executes if n is equal to constant1;
break;
case constant2:
statement be executed if n is equal to constant2;
break;
. . . default: // statements be executed if n doesn't match any constant
}
***********************************************
** if there are more than two conditions ,then switch statement is used.
Hope it helps you.
Answered by
10
There are following types of conditional statements in C.
- If statement.
- If-Else statement.
- Nested If-else statement.
- If-Else If ladder.
- Switch statement.
Similar questions
English,
8 months ago
Hindi,
8 months ago
Chemistry,
8 months ago
Computer Science,
1 year ago
Biology,
1 year ago
Social Sciences,
1 year ago
Physics,
1 year ago