There is one paragraph on page 45 which states, “Because of the way a C compiler generates code, the else requires far fewer machine instructions than an additional if and is, therefore, more efficient”.
In other words;
if (choice ==1) printf("%f", num / 3.28); if (choice ==2) printf("%f", num * 3.28); ...
takes the compiler a lot longer to compile into machine instructions than the following;
if (num2 == 0) printf("Cannot divide by zero."); else printf("Answer is: %d.", num1 / num2); ...
However, that was over 15 years ago. The question that was posed and that I will somehow find out is;
If i were to write two if statements that were the exact opposite of each other, would the compiler be able to optimize the machine code and change the two ifs to a logical if/else statement?