You should read the XC8 User manual, I think you will find answers to your questions there. Normally you write code in .c files, and use the header file .h for references, macros and prototypes, in a multi source file project.
it is usual to place code in .c files with function prototypes and variable declarations etc in header file.
placing actual code such as the definition of an isr (or any other function definition) in a header file could cause problems if you include the header files in more than one .c file in a project - you will get multiple definitions of a symbol at link time
thanks for the reply horace1 and embpic..
i wrote the program and the compiler accepted it as the header file but the o/p is different from what i expect..