The layout of nested if
statements is a matter of
convention. Here is another common arrangement:
#includemain ( ) { int ratio; scanf ("%i", &ratio); if (ratio < 10) printf ("It is cheap!\n"); else if (ratio > 30) printf ("It is expensive!\n"); }
Whatever convention you use, you should be able to defend it on the ground that you think it contributes to program clarity.