Basics of C Programming

⯈Basic C Programs

Header files in C

  • Header files have collection of functions in it. The header files are used so that the code can be reused across the programs.
  • Header files have extension of .h
  • The header files are written in link section of the C program.
  • The header files can be built-in, provided by the compiler or can be user-defined.
  • We include header files in our program using #include.
  • We can write the header files either in angle brackets or in double quotations. 
  • If we write the header files in angle bracket, it will search only in the system folder (where compiler is installed)
  • If we write in double quotations first it will search in current folder, where the C program is written, if not found then it will search in system folder.

Some commonly used header files


std is standard, i is input and o is output.

All the input-output functions like printf, scanf, sprintf, gets, puts, getchar, putchar are defined in stdio.h

So, if we want to use any of the input-output functions in our program we need to include stdio.h


All the mathematical functions like sin, cos, tan, ceil, floor, etc.,are defined in math.h

So, if we want to use any mathematical functions in our program we need to include math.h


Stands for standard library.

This header file includes exit function, all dynamic memory allocation functions like malloc, realloc, calloc and free.


This header file contains all the MACROS that define the lower-range and upper-range of the int and char datatype.

MACRO Value Description
The maximum value that the int data type can store.
The minimum value that the integer can store.
The maximum value that the unsigned int can store.
(The minimum value is 0)
Maximum value that long int can store
Minimum value that long int can store


All the string functionalities like strcpy, strlen etc., are defined in string.h

Scroll to Top