Write a JavaScript program to check from two given integers whether one of them is 8 or their sum or difference is 8
- برمجة جافاسكربت java script
- 2021-06-01
- ahmadghneem
الأجوبة
function check8(x, y) {
if (x == 8 || y == 8) {
return true;
}
if (x + y == 8 || Math.abs(x - y) == 8)
{
return true;
}
return false;
}
console.log(check8(7, 8));
console.log(check8(16, 8));
console.log(check8(24, 32));
console.log(check8(17, 18));
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال