I took that challenge on this site to change decimal to binary, it works ok exept the binary numbers come out in reverse. Any way to fix?(i stuck a \n in there to make it go up and down, makes it a little better)
Code:#include <iostream> using namespace std; int main() { int deci = 1; const int base2=2; cout<< "Enter a number you want in binary: "; for(;;) {if(deci == 0) {cout<< "Enter another number you want in binary: ";} cin>> deci; cin.ignore(); while (deci >= 0) { cout<< " " <<deci % base2 << "\n"; deci = deci / base2; if (deci == 0) break; } continue; } cin.get(); return 0; }