What is the purpose of header files in C language?

Header files in C contain declarations for functions, macros, constants, and variables that are used across multiple source files. They help in separating the interface of a program from its implementation. By including header files using the #include directive, programmers can ensure that the necessary declarations are available in each file that uses the functions or variables defined in those header files. This allows for modular code, reusability, and easier maintenance.