Q:

Write a JavaScript program to check whether a given positive number is a multiple of 3 or a multiple of 7

0

Write a JavaScript program to check whether a given positive number is a multiple of 3 or a multiple of 7.

All Answers

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

function test37(x) 
{
  if (x % 3 == 0 || x % 7 == 0) 
  {
    return true;
  } 
  else {
    return false;
  }
}

console.log(test37(12));
console.log(test37(14));
console.log(test37(10));
console.log(test37(11));

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