I am trying to make my own algorithm for converting to binary from decade system. But somehow my code doesn't work. Here it is:
http://pastebin.com/9SEgT56iIf you don't understand, let me explain. Variable ValueInteger is number passed by function (it's a decade number but passed as string). Variable size is size of array remainder. I have also the variable (String) that take this number, and later use it to convert string to int. So, when I do all that, I try simply idea. Repeat loop until that same number don't become 0 and it should become 0, because as we divide number with 2, in one moment it must be 0. Inside this loop, I take each reminder in array with statement :
remainder[i++] = ValueInteger % 2;
That sound quite logical to me and it should work. After that I simply divide original number with 2 and continue to loop again. After loop is done, I try to reverse values within array (because we read binary number in opposite direction). AAAND, after that I try to present results, but whenever I do that, there is this error: