DamnSchool
When a series of if..else statement are occurred in a program, we can write an entire if..else statement in another if..else statement called nesting, and the statement is called nested if.

Nested if else statement

#include<stdio.h>
int main()
{
int n;
printf("Enter a number:");
scanf("%d",&n);
if(n==5)
{printf("\n play foot ball");}
else{
if(n==10)
{printf("Play cricket");}
else
{printf("don't play");}
}
}

Run Example >

< Previous Next >

Privacy Policy Terms of Service About
Creative Commons License
This work is licensed under a Creative Commons Attribution-NoDerivatives 4.0 International License.