0
Even number?
Problem below, cannot figure out what my mistake is. Any help appreciated (It's saying my == is incorrect) . function main(){ var numGuests = (parseInt(readLine (), 10) if (numGuests % == 0) (console.log("Right")); else(console.log("Wrong")); https://www.sololearn.com/learning/1024/1137/1398/2
2 Respostas
+ 6
You need to ‘divide’ (%) numGuests by 2 before you perform the comparison operation (==).
Your if statement should be:
if(numGuests % 2 == 0)
+ 1
Thanks so much, Elizabeth Kelly. I really appreciate your help:).