Very good and genuine question.
First of all let me answer your second query :
what is library files in above definition of linking a C program
Ans : A library refers to the set of common functions that are needed by a developer for writing the programmes. e.g For doing string operations one needs strconcat, strcopy etc. These are string related functions. So these are written in string.c (just for example) so string.c is library file. In order to use this library we have to use string.h in the header of the c programme. Other examples are Math.h, Stdio.h etc.
my question is that what is purpose of linking a c program why it is need
The concept of linking can be better understood from
this link[
^]
Hope this helps.
All the best.