Exercise 9 weird error!


#1


Exercise # 9/12

Modulo.java:5: error: unexpected type
System.out.println(myRemainder)= 14 % 6;
----------------------^
required: variable
found: value
1 error

(ignore the "----------", i had to place the ^ correctly)


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

		int myRemainder = 2;
		System.out.println(myRemainder)= 14 % 6;

	}
}


#2

Assignment requires a variable on the left side. Are you trying to print or assign at that line? Looks like a bit of both.


#3

Hello

public class Modulo {
	public static void main(String[] args) {
		int myRemainder = 7 % 5;
		System.out.println(myRemainder);
	}
}

#4

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