How to find the remainder of dividing two numbers without using the modulo operator!! My teacher gave me this exact exercise and It\'s only my 5th lecture in a course calle
I've just tried this
public static void main (String [] args){ int a = 50; int b = 9; int c = a%b; int d = a - (a/b)*b; System.out.println(c); System.out.println(d); }
And it seems to work. What types are your variables?