INTRODUCTION:
In C programming, decision control structures allow developers to create logical branching in their code. This structure is used to make decisions based on the input values and execute the appropriate code block based on the conditions. There are two types of decision control structures in C programming: If-else and Switch statements.
STATEMENTS:
The most typical decision control structure in C programming is if-else statements. These commands are used to run a block of code in response to a certain circumstance. The code inside the if block will be performed if the condition is true, and the code inside the else block will be executed if the condition is false.
For example, consider the following code:
include
int main() {
int x = 10;
if(x > 5) {
printf(“x is greater than 5\n”);
} else {
printf(“x is less than or equal to 5\n”);
}
return 0;
}
In this example, the code inside the if block will be performed if the value of x is more than 5, and the result will be “x is greater than 5”. The result will read “x is less than or equal to 5” if the value of x is less than or equal to 5. Otherwise, the code inside the else block will run.
SWITCH STATEMENT:
On the other hand, switch statements are used to choose which of numerous code blocks should be executed. A variable’s value is assessed by the switch statement, which contrasts it with the values listed in each case statement. If a match is discovered, the case block’s code will run.


For example, consider the following code:
include
int main() {
int day = 1;
switch(day) {
case 1:
printf(“Monday\n”);
break;
case 2:
printf(“Tuesday\n”);
break;
case 3:
printf(“Wednesday\n”);
break;
case 4:
printf(“Thursday\n”);
break;
case 5:
printf(“Friday\n”);
break;
case 6:
printf(“Saturday\n”);
break;
case 7:
printf(“Sunday\n”);
break;
default:
printf(“Invalid day\n”);
}
return 0;
}
In this case, the result will be “Monday” if the value of the variable “day” is 1. The output will be “Tuesday” if “day” has a value of 2, and so on. The code inside the default block will be executed and the output will read “Invalid day” if the value of “day” is not between 1 and 7.
CONCLUSION:
To sum up, decision control structures are crucial to C programming because they let programmers add logical branching to their code. Developers can design complicated programmers that make decisions based on the input values by employing if-else and switch statements, which results in more effective and efficient systems.