Home Segments Index Top Previous Next

159: Mainline

The if-else statement is like the if statement, except that there is a second embedded statement, one that follows else:

if (Boolean expression) 
   if-true statement 
  else 
   if-false statement 

The if-false statement is executed if the Boolean expression evaluates to 0 or, said another way, if the Boolean expression is false.