Example of nesting if/else statements together: if (a > 100) { if (b <= 0) bigAndNeg = 1; else bisAndPos = 1; } else small = 1; -------------------------------------------------------------------- Which "if" does the else match up with? if (a > 100) if (b <= 0) x = 1; else y = 1; ----------------------------------------- The normal way of indenting for the above example: if (a > 100) if (b <= 0) x = 1; else y = 1; ---------------------------------------- Use a block if you want the "else" to match the first "if" if (a > 100) { if (b <= 0) x = 1; } else y = 1; --------------------------------------- Mutually exclusive conditions -- only one will match: if (score >= 90) grade = 'A'; else if (score >= 80) grade = 'B'; else if (score >= 70) grade = 'C'; else if (score >= 60) grade = 'D'; else grade = 'F'; ------------------------------------ Another common way of indenting the above example: if (score >= 90) grade = 'A'; else if (score >= 80) grade = 'B'; else if (score >= 70) grade = 'C'; else if (score >= 60) grade = 'D'; else grade = 'F'; ----------------------------------