The if account by itself will assassinate a individual statement, or a accumulation of statements, if the announcement afterward if evaluates to true. It does annihilation if the announcement evaluates to false.

SIMPLE IF ELSE PROGRAM :



/* Calculation of gross salary */
main( )
{
float base, gross, da, hra ;
printf ( "Enter basic salary " ) ;
scanf ( "%f", &base ) ;
if (base < 2000 )
{
hra =base * 20 / 100 ;
da = base * 80 / 100 ;
}
else
{
hra = 100 ;
da = base * 90 / 100 ;
}
gross = base + hra + da ;
printf ( "gross salary = Rs. %f", gross ) ;
}


0 comments to "IF ELSE STATEMENT"

Post a Comment

Powered by Blogger.