The segmentation fault is a programming error, means the program is trying to access an invalid memory location or memory which does not exist.
See an example program of segmentation fault:
/* This line will give segmentation fault */
/* Accessing pointer variable ‘num’ without allocating memory */
*num = 10;
Segmentation fault (core dumped)