Segmentation Fault

my code is giving segmentation fault error. Please review my code :- https://ide.codingblocks.com/s/262336

Okay I will check for errors in the code. Since the logic is correct it is most probably due to index manipulation.
Till then you can try to search for segmentation fault and why does it happen

In your lcs_dp function, your i and j are exceeding range leading to segmentation fault.
Also is your line 56 correct?

I am having Segmentation fault in LCS function not LCS_DP

Bro Lcs function is correct if you are looking at line number from the compiler that is line number of execution trace not the code.