but I feel like it is very inefficient. The nested if statements were to account for the number of digits that are in each binary number between X integer and Y integer. I feel like im too repetitive.
Can you guys point me to a solution where it is less repetitive, but without loops?
#include <iostream>
#include <string>
usingnamespace std;
void breakItDown(int a,string &ans){
//-------------------------------
// Put something in here and call
// breakItDown in this function.
// Maybe save the answer in ans
}
int main(void){
string answer;
int i(10);
breakItDown(i,answer);
cout << answer << endl;
return 0;
}