0
JS help
Entrance to the club is only permitted in pairs. Take the number of customers in the club as input, and, if all of them have a pair, output to the console "Right", otherwise output "Wrong". Sample Input 14 Sample Output Right function main() { var numberGuests = parseInt(readLine(), 10) // Your code here if (numberGuests == ) { console.log("Right"); } else { console.log("Wrong"); } } Think I'm missing something. They haven't taught how to determine if a number is even or odd.
2 Answers
+ 1
% -> this operator returns the remainder.
If numberGuests % 2 == 0, Right.
0
Thanks! Makes sense now. Wouldn't have thought of using it that way