[c] implement search using while-loop