title: Decimal to Binary code
body: <p>I'm doing a java project where I have to convert from binary numbers and decimals.
  I'm working on converting from decimal to binary right now.
  This is the bit of code that i have.
  I don't know how to loop the remainders multiple times in this code.</p>
  
  <pre><code>public static void decimalToBinary()   {
    Scanner input = new Scanner (System.in);
    System.out.println ("Input decimal number");
    String decimal = input.next();
    int x = Integer.parseInt(decimal);
    int remainder = x%2;
    char[] charArray = decimal.toCharArray();
  }
  </code></pre>
  
  <p>I don't know how to continue this.
  Thank you for your answers so far but i want to complete this with an array thats the challegne of the problem.</p>