Do not specify the second condition:- if(board[j]!!=NUL_CHAR)
Write something like [I]if<condition> dothis else dothat. Also your logic seems to be incorrect, it looks like only the first value gets...