Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let n;
- let max;
- while (n != 0) {
- n = prompt("Введіть число");
- if (n % 2 == 0) { //код не заходить в цю, умову не розумію чому
- console.log('заходить до if (n % 2 == 0)');
- console.log(`n > max: ${n} > ${max} === ${n > max}`);
- if (n > max) {
- console.log('заходить до if (n > max)')
- max = n
- }
- }
- }
- console.log("Найбільше число з тих що були введені це " + n);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement