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?
117 visits
Outline:Câu lệnh Nested if và switch -Câu lệnh Nested if. -Câu lệnh Switch. -Cú pháo cho câu lệnh nested-if -Cú pháp cho câu lệnh switch -Câu lệnh break -So sánh giữa câu lệnh nested if-else và switch.
Câu lệnh Nested if và switch -Câu lệnh Nested if. -Câu lệnh Switch. -Cú pháo cho câu lệnh nested-if -Cú pháp cho câu lệnh switch -Câu lệnh break -So sánh giữa câu lệnh nested if-else và switch.
Show video info
Pre-requisite