Although the compiler doesn't care about formatting, you as the programmer do. The previous example without any indentation is much harder to follow and to understand the flow of logic:
if (average >= 90) grade = 'A'; else if (average >= 80) grade = 'B'; else if (average >= 70) grade = 'C'; else if (average >= 60) grade = 'D'; else grade = 'F';