title: decimal to binary converter c++?
body: <pre><code>int inputNumber=0;
  int divisionStore=0,modStore=0;
  vector&lt;int&gt; mainVector;
  
  cout &lt;&lt; "\nEnter a Number to Convert to Binary.\n" &lt;&lt; endl;
  
  cin &gt;&gt; inputNumber;
  
  do
  {
      modStore=inputNumber%2;
      inputNumber=inputNumber/2;
      mainVector.push_back(modStore);
  
  }while(inputNumber!=1);
  
  for (int i=0;i&lt;mainVector.size();i++)
  {
      cout&lt;&lt;endl&lt;&lt;mainVector[i]&lt;&lt;endl;
  }
  </code></pre>
  
  <p>Seems like there is a logical error but I cant find whats wrong with it? The program does not print the correct conversion as it seems like the loop ends before it can push the last number. </p>