What is the difference between a header file and a source file in C language?
A. A header file contains declarations of functions, macros, constants, etc., and a source file contains definitions of functions, variables, etc.
B. A header file has the extension .h and a source file has the extension .c
C. A header file can be included in a source file using #include directive and a source file can be compiled into an executable file
D. All of the above
Answer:D
What is the difference between a header file and a source file in C language?
A. A header file contains declarations of functions, macros, constants, etc., and a source file contains definitions of functions, variables, etc. B. A header file has the extension .h and a source file has the extension .c C. A header file can be included in a source file using #include directive and a source file can be compiled into an executable file D. All of the above
Explanation: In the C programming language, there are two different types of files: header files and source files. Functions, macros, constants, and other items that can be used in a source file are declared in a header file. The #include directive can be used to include a header file, which has the.h extension, in a source file. Definitions for variables, functions, and other elements that carry out the program's logic can be found in a source file. A compiler can turn a source file with the.c extension into an executable file.