10
1010
void control_q14_decimal_to_binary() {
int decimal = 25;
int binary[32];
int index = 0;
int temp = decimal;
while(temp > 0) {
binary[index] = temp % 2;
temp = temp / 2;
index++;
}
cout << "Decimal " << decimal << " in binary: ";
for(int i = index - 1; i >= 0; i--) {
cout << binary[i];
}
cout << endl;
}
void control_q14_decimal_to_binary() {
int decimal = 25;
int binary[32];
int index = 0;
int temp = decimal;
while(temp > 0) {
binary[index] = temp % 2;
temp = temp / 2;
index++;
}
cout << "Decimal " << decimal << " in binary: ";
for(int i = index - 1; i >= 0; i--) {
cout << binary[i];
}
cout << endl;
}