I think it’s being interpreted like this:
if((i+1>=0 && i+1<n && j>=0 && j<m) ? (true) : (false && board[i+1][j]==word[ind] && !visited[i+1][j])))
so all it’s really checking is the array bounds, and not the word matches or visited. Which matches up with what I saw when testing it.
Test it. Replace
#define inrange(i,j,n,m) (i>=0 && i<n && j>=0 && j<m)?true:false
with
#define inrange(i,j,n,m) (i>=0 && i<n && j>=0 && j<m)