1 - choose number according to the order number;
2 - add 3 to the given number and replace it with its opposite;
3 - show how the number is represented in memory.
Order number: #4;
2-digit number: 85;
3-digit number: 285.
85+3=88 -88
We will convert this negative decimal to binary with JavaScript built-in functions. But we will take only 8 bits of the result. Code:
(-88>>>0).toString(2).slice(24)
-88 in binary is 10101000.
2) 285+3=288 -288
We will convert this negative decimal to binary with JavaScript built-in functions. But we will take only 16 bits of the result. Code:
(-288>>>0).toString(2).slice(16)