It is giving tle why is it so?

My code is - https://ide.codingblocks.com/s/326432

Hey correction is in binary search function.

    else if(a[mid]>m)
        j=m-1;  //here it should be mid-1
    else
        i=m+1;   //here it should be mid+1