+ 1
I can use some help on the even or odd practice. How does one declare an even to compare a random number to?
Even or odd practice lesson 14.2
5 Respuestas
+ 3
Could you maybe add the relevant challenge description or go into more detail of what you have to do? Without pro, many can't access the task, and I'm afraid I am a bit confused by your question. Are you supposed to evaluate whether a (random) number is even or odd?
+ 3
Yes, you will want to use simple maths for that one. The basic idea is that when you divide a number by two, even numbers will have a remainder of zero, while odd numbers have a non-zero remainder. Does that already give you an idea?
+ 1
I know the code I need except for the "even" to compare the input to.
0
Yes shadow. I am required to take user input (random number) and output (print) even if the number is even and odd if it is odd. I know how to do every part except compare a random number to an unspecified variable to determine whether it is even or odd. Is this a math issue I am missing or what?
0
Yes it does!! Thanks. I was not thinking division. I was trying addition. Duh!! Thank you.