Convert decimal to binary

What is the decimal value of (128)10 in binary?

Choose one:

a. 10100000

b. 10001100

c. 11100000

Answer:

The decimal value of (128)10 in binary is option c. 11100000.

In order to convert decimal (128)10 to binary, we use the method of repeated division by 2.

Starting with the decimal number 128, we divide it by 2 which gives us a quotient of 64 and a remainder of 0.

Dividing 64 by 2, we get a quotient of 32 and a remainder of 0.

Continuing this process until we reach the quotient of 1, we get 1111111 as the binary equivalent.

However, since we read the remainders in reverse order to get the final binary number, the binary equivalent of decimal 128 is 11100000.

← How to modify short names with python How to calculate sum of first n integers in an array using recursive function →