This is what I have for my conversion function so far It takes an unsigned integer as a parameter. It should give the result like
outputBinary(1) //=> 0000 0000 0000 0000 0000 0000 0000 0001
outputBinary(5) //=> 0000 0000 0000 0000 0000 0000 0000 0101
outputBinary(1000000) //=> 0000 0000 0000 1111 0100 0010 0100 0000
void outputBinary(unsigned int x){
int temp = x;
int remain;
string binary = "";
while(temp != 0){
remain = temp%2;
binary = binary + to_string(remain);
temp = temp/2;
}
cout << binary << endl;
}