It is nothing different from if else. It is jst rearranging the else with the if followed by it. the else if program is given below which proves the above statement:

/* else if  demo */
main( )
{
int a,b,c,d,e, pr ;
pr = (a+b+c+d+e) / pr ;
if ( pr >= 60 )
printf ( "First division" ) ;
else if ( pr >= 50 )
printf ( "Second division" ) ;
else if ( pr >= 40 )
printf ( "Third division" ) ;
else
printf ( "fail" ) ;
}


0 comments to "ELSE IF STATEMENT"

Post a Comment

Powered by Blogger.