C Programming Reference


C Programming Reference >> C Basic Tutorials >> C Keywords Home >>

elseui

30/12/06 -  Views - Ratings :   3.48 of 5 / 155 Votes

This keyowrd can only be used with if and not by its own. The code block asssociated with else is executed when conditon of if fails to satisfy. ALways either if code block or else code block is executed but never both.

Code -
void function (void)
{
int a,b;
scanf ("%d %d", &a, &b);
if (a==b) printf ("A equals to B");
else printf ("A not equals to B");   
}

Back To Top


      

 

 

© 2006 cencyclopedia.com