Nested if else means if else into if else i.e. multiple if else statements included in one if else statement.Below is the program demonstrating if else :


/* A demo of nested if-else */
main( )
{
int m ;
printf ( "Enter either 0 or 1" ) ;
scanf ( "%d", &m ) ;
if ( m == 0 )
printf ( "this is zero" ) ;
else
{
if ( m == 1 )
printf ( "this is one" ) ;
else
printf ( "wrong choice" ) ;
}
}


0 comments to "NESTED IF ELSE"

Post a Comment

Powered by Blogger.