The correct answer is D. All of the above.
Declaring variables has several advantages:
- It avoids errors from misspelled variable names. The compiler can check that the variable name is declared before it is used, and that it is used in a consistent way.
- It helps the linker work efficiently. The linker can resolve references to variables by looking at the variable declarations.
- It simplifies the writing of very short programs. By declaring variables, you can avoid having to repeat the same variable name multiple times in a program.
Option A is correct because declaring variables helps to avoid errors from misspelled variable names. The compiler can check that the variable name is declared before it
11.4-132.3s0-89.4-11.4-132.3zm-317.5 213.5V175.2l142.7 81.2-142.7 81.2z"/> Subscribe on YouTube