Source code https://ide.codingblocks.com/s/230115
Why this code is not working getting segmentation fault
modified code
you have to add one condition
if(start==end) return temp;
in your code
for(int j=start;j<end;j++)
this is wrong you have to write
for(int j=start;j<=end;j++)
main mistake is that first arr is pre[] not in[]