arithmetic underflow in c - Search