Question:

Which one of the following classes of statements usually produces no executable code when compiled?

Show Hint

Declarations affect compilation metadata, not runtime execution.
Updated On: Jul 6, 2026
  • Declarations
  • Assignment statements
  • Input and output statements
  • Control statements
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Approach Solution - 1

Step 1: Understanding declarations.
Declarations specify variables, data types, and storage requirements but do not perform any computation or action at runtime.
Step 2: Comparison with other statements.
Assignment statements generate code to store values. Input/output statements generate code for data transfer. Control statements generate branching or looping code.
Step 3: Effect of declarations during compilation.
Declarations mainly affect symbol tables and memory allocation but do not result in executable instructions.
Step 4: Final conclusion.
Therefore, declarations usually produce no executable code when compiled.
Was this answer helpful?
0
0
Show Solution
collegedunia
Verified By Collegedunia

Approach Solution -2

The question asks which kind of statement typically produces no runnable machine instructions when compiled. Let's check each:

  1. Declarations: A declaration like "int x;" only tells the compiler to reserve space for a variable and record its type in the symbol table. It doesn't ask the machine to do anything at runtime, so it generates no executable instructions, only bookkeeping information used by the compiler itself.
  2. Assignment statements: These require the CPU to compute a value and store it into a memory location or register at runtime, which the compiler must translate into actual load/store/arithmetic instructions.
  3. Input and output statements: These require the program to actually communicate with a device or file at runtime, which needs generated instructions (often calls to library or system routines) to carry out.
  4. Control statements: Loops and conditionals need to alter the flow of execution at runtime, which the compiler implements using comparison and branch/jump instructions.

Every other category needs the CPU to actually do something while the program runs; a declaration only affects information the compiler tracks about the program, not the running program itself.

Therefore, the correct answer is Declarations.

Was this answer helpful?
0
0