if you're using the int datatype, you're capped somewhere around 8 or 9 digits i believe.
what you need is a for loop, your current array can hold 100 digits it appears, what you would want to do is start at the end [99], and go down to [0] so something like this might work...
1 2 3
|
for (int i = 99; i >= 0 ; --i){
numr[i] = numans%base;
numans /= base;}
|
but like i said, int is limited in size for your numbers.
you should also be sure to throw in 0's for the unused portion of the array, and you'll want it to not print the beginning zeros.
also, because of the nature of arrays, you can simply write in
to output your array... however this will display your beginning zeros.
alternatively you can use another for() loop with a nested if() statement to display your number or you could use a while loop to find the first actual number, then output from there using a for loop.