Fonction recherche
tabA = [2,4,5,7,11,15];
print(rechercheElement2(tabA,5));
print(rechercheElement2(tabA,3));
function rechercheElement2(tab, x){
i=0;
while(i<tab.length){
if (tab[i] == x) {
return "VRAI";}
else
if (tab[i] > x) {
return "FAUX";}
else
i = i + 1;
}
return "FAUX";
}
print(tabA);