Phase 1: Pre-processing: When the compilation of a C program begins, it starts with the pre-processing. The compiler begins by reading the contents of the header and inserts it into the program text. The header and defined macros are expanded and merged within the file and produces a transitory file. Phase 2: Compilation: In this phase…