How to write a java program that uses loops to convert a decimal number into...

yahskaraghu

New member
...its binary equivalent? Using for or while loops, how can I write a program to convert a user-inputted decimal number into its equivalent in binary?
I've already set up a scanner to obtain the user's number, and I think that I have to use Math.pow to set up the 2^x statements to solve for the number, but I have no idea how to actually set up the programming. If anyone could at least give me an outline of how to get started on it, I'd really appreciate it.
 
Back
Top