public class MainClass { public static void main(String[] argv) { int a = 123, b = 23, c, d; long e, f; c = a * b / b; d = a / b * b; System.out.println("a is " + a + "\nb is " + b + "\nc is " + c + "\nd is " + d); e = (long) a * b / b; f = (long) a / b * b; System.out.println("\ne is " + e + "\nf is " + f); } }
a is 123 b is 23 c is 123 d is 115 e is 123 f is 115