23.6k views
5 votes
What is an unsigned data type that occupies 1 byte of memory and encodes numbers from 0 to 255?

1) highByte()
2) unsigned char
3) unsigned long
4) volatile

User Kevin Choi
by
7.8k points

1 Answer

3 votes

Final answer:

An unsigned char is a data type that occupies 1 byte and can store values from 0 to 255.

Step-by-step explanation:

The unsigned data type that occupies 1 byte of memory and encodes numbers from 0 to 255 is called the unsigned char. Unlike signed data types which can represent both positive and negative values, an unsigned char is used to store only non-negative values, i.e., positive numbers and zero. Since 1 byte consists of 8 bits, and each bit can represent two values (0 or 1), an unsigned char can encode 28 different values which equals 256 distinct values ranging from 0 to 255.

User CARLOS LOTH
by
7.6k points