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

  • (A) linking
  • (B) assembling
  • (C) preprocessing
  • (D) compiling
πŸ’¬ Discuss
βœ… Correct Answer: (C) preprocessing
Explanation:

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.

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.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
346
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Akash Lawaniya
Publisher
πŸ“ˆ
90%
Success Rate