AP Computer Science HELP! =/

<p>I need help on making a program that converts binary to decimal. How do you do a program that can convert all binary numbers?</p>

<p>I remember doing this, say n is your binary number, just do a loop that as long as n % 2!=0 or 1, keep dividing by 10 or something of that nature, which will get you the number of digits, then do a loop that counts down for however many digits there are then keep adding the 2^nth digit.
Something like that. You’ll have to excuse me, my skills are somewhat rusty.</p>

<p>Or if you want it the cheap way, there’s a method that’ll do that for you. I don’t remember exactly what it was called, but it is there.</p>

<p><a href=“http://www.techimo.com/forum/archive/index.php/t-16409.html[/url]”>http://www.techimo.com/forum/archive/index.php/t-16409.html&lt;/a&gt;&lt;/p&gt;