Which binary representation equals decimal 4?

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 representation equals decimal 4?

Explanation:
Binary numbers use powers of two for each position, with the rightmost bit representing 2^0 and the next one 2^1, and so on. In a 4-bit layout the positions represent 8, 4, 2, and 1 from left to right. The decimal number 4 has only the 4’s place set to 1, so the pattern is 0 1 0 0, written as 0100. The other patterns correspond to 5 (0101), 3 (0011), and 8 (1000). Leading zeros don’t change the value, so 0100 correctly represents decimal 4.

Binary numbers use powers of two for each position, with the rightmost bit representing 2^0 and the next one 2^1, and so on. In a 4-bit layout the positions represent 8, 4, 2, and 1 from left to right. The decimal number 4 has only the 4’s place set to 1, so the pattern is 0 1 0 0, written as 0100. The other patterns correspond to 5 (0101), 3 (0011), and 8 (1000). Leading zeros don’t change the value, so 0100 correctly represents decimal 4.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy