Created
October 5, 2022 07:14
-
-
Save gydoma/db0d06e4988845554479da54abc4b8d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lista3 = new Array(10, -10, 20, -20, 30, -30); | |
var El = 20; | |
sum = 0; | |
function eldontes(lista, El, sum){ | |
for(let i = 0; i < lista.length; i++){ | |
if (lista[i] != El){ | |
sum++; | |
}; | |
}; | |
if (sum < lista.length){ | |
console.log("A listában megvan a keresett szám."); | |
} | |
else{ | |
console.log("A listában nincsen a keresett szám."); | |
}; | |
}; | |
eldontes(lista3, El, sum); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment