Go to the online java ide at ideone.com
Paste this into the body of the main() method
int a,b,c,d;
for(a=0; a < 10; a++) for(b=0; b < 10; b++) for(c=0; c < 10; c++) for(d=0; d < 10; d++)
if(d * (100 * a + 10 * b + c) == 1000 * b + 100 * a + 10 * d + c)
System.out.println("Solution: a = " + a + " b = " + b + " c = " + c + " d = " + d);
System.out.println("Done");
You will find there are four solutions:
Solution: a = 0 b = 0 c = 0 d = 0
Solution: a = 2 b = 1 c = 0 d = 6
Solution: a = 5 b = 1 c = 0 d = 3
Solution: a = 8 b = 6 c = 0 d = 8
None of them match the conditions of the question, that the digits are from 1-9.
Posted By: Old Man, Jan 10, 14:09:23
Written & Designed By Ben Graves 1999-2025