But it is not an nested if program.It is a ladder if.
A)Write a program to check whether the age of the employee is between 20 and 60? B) Write a program to check whether the age of the employee is between 20 and 59? Here, I mentioned two questions.Which one is correct?We cant able to write program to the Question A?In the tutorial also asked the students to write coding for A? B) Write a program to check whether the age of the employee is between 20 and 59?CODING:-#include<stdio.h>int main(){ int a; printf("Enter the age of a employee between 20 to 59"); scanf("%d",&a); if((a/10)==5){ printf(" AGE RANGE BETWEEN 50 to 59");} else if((a/10)==3){ printf(" AGE RANGE BETWEEN 30 to 49");}else if((a/10)==2){ printf(" AGE RANGE BETWEEN 20 to 29");}else{printf("AGE NOT IN RANGE\n");}return 0;}
Write a program to check whether the age of the employee is between 20 and 60? Is the above question correct? Write a program to check whether the age of the employee is between 20 and 59? Or this one
COMPARE TO SWITCH AND IF ELSE, which statement is more often used in real time programming
Nested if else is used specially in which type of program ?
What are conditional statements?
38499 visits
Outline:Nested if and switch statement -Nested if statement. -Switch statement. -Syntax for nested-if statement -Syntax for switch statement -break statement -Comparison between nested if-else and switch statement
Nested if and switch statement -Nested if statement. -Switch statement. -Syntax for nested-if statement -Syntax for switch statement -break statement -Comparison between nested if-else and switch statement
Show video info
Pre-requisite