/* int t1,t2;
so here is the problem, the problem works for all numbers that don't contain a zero, a number with is somehow mistreated....
ex.,the prgm outputs 1255 as a viable number, but 1255*2=2510 ,having a zero, does not have the same digits as the original number.........
any thoughts would be appreciated.......been breaking my head for long....
You have a problem, your program only checks if both numbers contain same digits and numbers could contain multiple same digits, so your program would say that 1255 and 1522 contain same digits in different order, which is not true.
You have to fix that first. (If you don't know how to solve this I could tell you)
And your program doesn't work with zeros because it doesn't work with any number, your conversion loop doesn't get the right digits of the number.
If you used a string instead of long int array (idk why did you used long since digits are only 0-9) you could use atoi function to get the digits as array of characters.
That is exactly what I though of, remove the digit from the second array once you have matched them.
But now I got an even better idea. Instead of searching to match all digits, you can just sort the arrays and if they are identical then they have the same digits. Can't be simpler than that.
And I told you to use strings instead of arrays of type long and to use itoa to convert an integer to a string because your method for making the digit arrays doesn't work right.
I'm talking about this:
1 2 3 4 5 6 7
If you still have problems then post your new code.