|(red face) apologies. my logic wrong. not enough math\computer classes or too long since. Hoist on mey own petard Oi is. LOL|
3. void main()
5. int x,y,z;
my understanding is: for each digit in number, reflect the 10's complement (ie: 10 minus digit): 183 = 927 674 = 436 etc.
but i'm probl'y wong. (seems to be a trend lately.)
if you are fielding successive digits by division,
you would need to:
C = 0
OUT = 0
do while num>0
'capture first digit in A and strip from number
A=num % 10
num = num - A
'shift the main number 1 digit
num = num / 10
'reverse (10's-complement) the captured digiit
A = 10 - A
'modulo to make 10=0, 9=1,. etc.
A = A % 10
'exponentiate the digit (1's, 10's, 100's)
A = A* ( C^10 )
OUT = OUT + A
sorry about my misinformation about modulo. seems i'm always wrong. take this into acct if using or adapting my code.