Computer Science, asked by sandeepmishra1768, 10 months ago

The program write a code snippet in which a set of three line occure ten times in different parts of the prigram

Answers

Answered by Anonymous
1

void decToBinary(int n)

{

// array to store binary number

int binaryNum[32];

// counter for binary array

int i = 0;

while (n > 0) {

// storing remainder in binary array

binaryNum[i] = n % 2;

n = n / 2;

i++;

}

// printing binary array in reverse order

for (int j = i - 1; j >= 0; j--)

cout << binaryNum[j];

}

Similar questions