I need help on lesson 9
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?
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)
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?
int myRemainder = put your modulo expression here;
so to get a remainder of 2 i would enter 10 % 4. is that correct?
Yes that's right.
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.
bro taht happend to me ... but i know the answer .... you ashould put this symbol ( ; ) after finishing the line
Try 12 % 10; I tried and it printed 2.