Stuck on question 9 modulo operator


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.

public class Modulo {
public static void main(String[] args) {

	int myRemainder = 




same here when i press get code it says it should be 10 % 2; but when i run the code it gives out number 0 and i cant complete the question can some one please help me


9. Math %

Well, something isn't right there. Using the Get code option should not be giving you

int myRemainder = 10 % 2;

not if it wants you to end up with a remainder of 2.

Use the Report a Bug link in that exercise.




11 / 3 = (3*3) + 2 ;
11 % 3 = 2;


I don't understand how did that work?


@abaltodano92hotmail_ take a look at this

Post here

it explains the modulo operator


Anyone can help me ? How I can do this exercise?


this did not work for me, I tried several correct answers. has anyone else made it past this step?


I tried:
int myRemainder = 11 % 3;

int myRemainder = 14 % 6;

int myRemainder = 16 % 7;

still showing a red X and not allowing me to continue in the course!


I also tried a lot of options. I wonder when they will fix it, so we can continue..


me too, I hate to show an incomplete course here!


Is there a way to skip this one exercise?


This exercise worked last time I went through it but I'm stuck too. I've reported it, I suggest you do too -- more dings might get attention faster.


I already reported it twice so I hope they notice soon..


Unfortunately no.

Give one of the other courses a try while we wait.


Damn it, I just wanted to practice java xp


Looks like Java ex.12 has a new bug too, so no rush :smile:


Could you give it another try now please?


Worked for me now. Seems this one is working again.


3 posts were split to a new topic: 9. modulo operator