What is wrong with Modulo in sect 9 of Intro to Java?

What is wrong with the modulo line in Learning Java? Not working!!!



Replace this line with your code. 


can you post your code here so we can see what you tried :slight_smile:

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

    int myRemainder = 7 % 5
    System.out.println(myRemainder);

}

}

i think the error massage you are getting?

Modulo.java:4: error: ';' expected
		int myRemainder = 7 % 5
                                       ^

so need a ;

int myRemainder = 7 % 5 ; // <= here

used ; and it worked. thanks for the fast reply : )

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