previous | index | next

"if...else", "if", and "return" Statements

In the code below, exactly one of A, B, or C will be done, no matter what the outcomes of test1 and test2 are.
if (test1)
   do A;
else if (test2)
   do B;
else
   do C;

previous | index | next