Skip to content

Exercise B4

Java Fundamentals exercises

Wk2 – Ex B4

Write a program called Modulus. Take in two integer values from the user; store in x and y. Using the modulus operator (%), determine if x is a multiple of y.

Enter x: 4
Enter y: 2
4 is a multiple of 2

Enter x: 5
Enter y: 2
5 is not a multiple of 2


Modulus.java