Computer Science, asked by pooniaparmod6862, 1 year ago

Code to take input from user and check it is divisble by 5 or 7

Answers

Answered by 3ddelano
0

Answer:

In Js,

const num = prompt("Type a number:");

if (num % 5 == 0 || num % 7 == 0){

console.log(true);

} else console.log(false)

Explanation:

The modulo operator (%) checks the remainder after division. For a number A to be divisible by another number B then A % B must be zero.

Similar questions