This forum is now read-only. Please use our new forums! Go to forums

0 points
over 11 years

Need help with this one!

I’m loving this tutorial for far but I have definitely missed something in this exercise! I passed the exercise but I don’t understand at all. If I put in simply ‘5%4’ then that is enough to get the pass, with the console saying ‘the first number is even’.

What is the first number it is referring to? Certainly not 5, that is an odd number. Nor the result of ‘5%4’, that is 1 which is also an odd number.

The only hint is that even numbers are divisible by 2, which for my part at least needs more context to be informative in any way.

Am I supposed to put something like a < or > sign as was given in the earlier lesson regarding if/else example? If so I think I need some more hand holding, the leap from printing a response depending on whether a number is bigger or smaller than another number to determining whether a number is odd or even has been too great for me.

Could someone please post the correct code (with no explanation please) so that I can play around with it and figure this out? Thanks.

Answer 51281e13a51935f020000ada

1 vote

Permalink

You are supposed to put like 5 * 4 or 5 / 4, not 5 % 4.

points
Submitted by Quang Ta
about 11 years

3 comments

Athithya over 9 years

how to write the multiplication symbol?

Kevin Liang over 9 years

@Athithya multiplication symbol is: *

Ridhwan Yusoff over 8 years

i dont undrestand.. what i have to write ?

Answer 54bf90f69113cbc546000c2b

1 vote

Permalink

3 + 3 This should work :D you can also use * or - but not %

points
Submitted by higuy111
about 9 years

Answer 5040c9e0788bb3000203accd

0 votes

Permalink

5%4 does not work in FF works in google

points
Submitted by Gregor Cunningham
over 11 years

Answer 54c27132d3292f801a001a81

0 votes

Permalink

thx

points
Submitted by Athithya
about 9 years