Types of Decision Making



Types of Decision Making Statements

  • In C- Programming decision making statements are used for defining the group of statements which will be executed when condition is true.
  • If condition is false, then else part statements will be executed.
  • There are three types of decision making control statements in C language.
    1. if statements
    2. if else statements
    3. nested if statements
C Decision Making Statement

if statements :

  • In these type of statements, if condition is true, then the respective block of code will be executed.

C Syntax

if (condition is true) 
{ 
    Statements execute; 
}

if else statements :

  • In these type of statements, group of statements are executed when condition is true.
  • If condition is false, then else part statements will be executed.
  • C Syntax

    if (condition is true) 
    { 
        Statement1; Statement2; 
    } 
    else 
    { 
        Statement3; Statement4; 
    }

    Nested if statements :

  • These type of statement works like in this way for example If condition 1 is false, then condition 2 is checked and the statements are executed if it is true. If condition 2 also gets failure, then else part is executed.
  • C Syntax

    if (condition1)
    { 
        Statement1; 
    }
    else if(condition2) 
    { 
        Statement2;
    } 
    else Statement 3;


    View More Quick Examples


    Related Searches to c decision making statement