Which binary string represents decimal 15?

Enhance your programming skills with the RECF Programming Test. Features flashcards and multiple choice questions with hints and explanations. Prepare for success!

Multiple Choice

Which binary string represents decimal 15?

Explanation:
In binary, each digit represents a power of two, from right to left: 1, 2, 4, 8, etc. To represent 15, you need the 8, 4, 2, and 1 positions all set to 1. That gives the string 1111, which equals 8 + 4 + 2 + 1 = 15. The other strings don’t reach 15: 1010 equals 8 + 2 = 10; 1110 equals 8 + 4 + 2 = 14; 1001 equals 8 + 1 = 9. So 1111 is the correct binary representation of 15.

In binary, each digit represents a power of two, from right to left: 1, 2, 4, 8, etc. To represent 15, you need the 8, 4, 2, and 1 positions all set to 1. That gives the string 1111, which equals 8 + 4 + 2 + 1 = 15.

The other strings don’t reach 15: 1010 equals 8 + 2 = 10; 1110 equals 8 + 4 + 2 = 14; 1001 equals 8 + 1 = 9. So 1111 is the correct binary representation of 15.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy