Lesson 9


#1

I need help on lesson 9


#2

For reference, here is the task:

Use the modulo operator to set the variable myRemainder equal to 2. You can use any two numbers that return a remainder value of 2.

Do you need help because you don't understand how modulo works?


#3

If you never used modulo it is basicily used to find the remainder if you divide 2 numbers for example
3 % 2 = 1 (1 is the remainder)
18 % 2 = 0 (0 because there is no remainder)


#4

i don't understand how to set it up in the java code. i know what would have a remainder of 2 but every time i enter it in it says there is an error. Can someone please help?


#5

int myRemainder = put your modulo expression here;

#7

so to get a remainder of 2 i would enter 10 % 4. is that correct?


#8

Yes that's right.


#9

Hi my name is ashtone and I am here to assist you.
Sorry but I am not sure how to help please ask someone else.


#10

bro taht happend to me ... but i know the answer .... you ashould put this symbol ( ; ) after finishing the line


#11

Try 12 % 10; I tried and it printed 2.