Decision Making

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 6

Decision Making

• Decision-making statements in programming


allow a program to perform different actions
based on whether a certain condition is true or
false
Types

• If Statement
• If else statement
• If else-if statement
• Nested if statement
• Switch statement
If Statement

• The if statement is the most straightforward


decision-making construct.

• It evaluates a condition and executes a block


of statements if the condition is true.
Program

• #include<stdio.h>
• int main()
• {

• int n=20;
• if(n>10)
• {
• printf("N is greater than 10\n");
• }
• }

You might also like