Q:

Write a JavaScript program to check two given numbers and return true if one of the number is 50 or if their sum is 50

0

Write a JavaScript program to check two given numbers and return true if one of the number is 50 or if their sum is 50.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

function test50(x, y) 
{
  return ((x == 50 || y == 50) || (x + y == 50));
}
console.log(test50(50, 50))
console.log(test50(20, 50))
console.log(test50(20, 20))
console.log(test50(20, 30))

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now