In the given program below,
void main()
{
int x=0xFE;
int y=0xF3;
.....
}
What values are assigned by x=0xFE
and y=0xF3
? What does 0x
represent?
Prefixes which indicates the base. For example, 0x10 indicates the value 16 in hexadecimal having prefix 0x.
An all-zero octet.
Writing a value with 0x
before means it is written in hexadecimal notation, where the numbers 0-9 and additional "number" A-F are used to get a number system with the base 16. The big advantage of this is that each hexadecimal digit represents exactly 4 bits.
0xFE = 254
0xF3 = 243
So x = 254 and y = 243.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With