Computer Science, asked by TbiaSupreme, 11 months ago

Write names of conditional control statements?

Answers

Answered by hukam0685
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.
Answered by ChromaticSoul
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