A

Akash Lawaniya • 9.58K Points
Tutor III

Q. What is the first stage of compilation of a C program?

  • (A) linking
  • (B) assembling
  • (C) preprocessing
  • (D) compiling

Explanation by: Mr. Dubey

The compilation of a C program goes through several stages:

Preprocessing:

  • The preprocessor handles directives like #include, #define, and #ifdef.
  • It replaces macros, expands header files, and processes conditional compilation.

Compilation:

  • Converts the preprocessed C code into assembly language.

Assembly:

  • Translates the assembly code into machine code (object file).

Linking:

  • Combines multiple object files and libraries into a single executable.

Since preprocessing is the first stage in this sequence, the correct answer is (C) Preprocessing.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics