Programa que transforma de un número decimal a binario.
Scripter
#include <iostream>
#include <list>
using namespace std;
int main()
{
int n, i;
list mod{};
cout << "Write the number to change to binary: ";
cin >> n;
for(n; n != 0; n /= 2){
i = n%2;
mod.push_front(i);
}
for(int val : mod){
cout << val;
}
}
Scripter
>>Write the number to change to binary: 73
1001001
Press ENTER to exit console.