NESTED if STATEMENTS: In simple words an if statement inside another if statement is called Nested if statement. Syntax: if(condition 1) { if(condition 2) {code if condition 1 and 2 both are satisfied;} } Example Code: Write a program to find whether the number entered by the user lies in a particular range. Ans: #include<stdio.h> #include<conio.h> void main() { int n; getch(); printf("\n enter the number "); scanf("%d",&n); if(a>0) { if(a<18) { printf("\n the entered number is in the given range"); } else { printf("\n the entered number is not in the given range"); } } else { printf("\n the number is not in the given range); } getch(); } The above code is written in code blocks Output: enter the number 17 the entered number is in the given range Explanation of the above Code: In the above code we have declared an variable of data type integ
This site is based on teaching the fundamentals of coding in the simplest way possible with my experience as a computer science student for beginners as well as for a learner who wants to master it.