4 // Searching for the values below
5 int to_find[NB_FINDS] = {57, -1};
7 int search (int tab[], int size, int to_find) {
8 int low = 0, high = size-1, i;
12 if (tab[i] == to_find) return i;
13 if (tab[i] > to_find) high = i-1;
14 if (tab[i] < to_find) low = i+1;
21 int tab[SIZE] = {-30, -18, 23, 57, 120};
25 for (i = 0 ; i < NB_FINDS ; i++)
26 println(search(tab, SIZE, to_find[i]));