How do you do the modulo operator? I'm stumped!


Replace this line with your code.


This % is the modulo operator.


I hit the delete button to far that I messed up the code. is it supposed to look like this.System.out.println(myRemainder);


lemme see all your code


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

	int myRemainder 
	System.out.println(myRemainder); 12 % 6 




its intro to java 9/12


int myRemainder = 14 % 4

Ive done the maths and this should work for a remainder of 2 but have i typed something wrong?


Im confused! Am I supposed to type it in or beside intl my Remainder or (myRemainder)?


I really dont know.. :confused:


the problem is here,

you are supposed to store20 % 9; in the variableint myRemainder so it would look like,

int myRemainder = 20 % 9;

then normally print out the variable,



it says this when i try that error: cannot find symbol
symbol: method printIn(int)
location: variable out of type PrintStream
1 error


Thanks man! I really needed that.


This is what ive been putting

int myRemainder = 14 % 4;


int myRemainder = 7 % 5;
****how can be remainder 2 after dividing?? anyone??****


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.