80.6k views
5 votes
A variable of type unsigned char stores a value of 255. If the variable value is decremented, what exception will occur

User Zilicon
by
6.1k points

1 Answer

0 votes

Answer:

No exception will occur

Step-by-step explanation:

Given

Unsigned Char

Value = 255

Operation = Decrement

Required

What type of exception occurs?

Let's assume the variable is a.

So, we have that

a = 255

The range of values of an unsigned char a is 0 to 255

So, when a is decremented by 1, the new value of a becomes 254

254 is still within the range of 0 to 255.

Hence, no exception will (or is excepted to) occur

User Bsyk
by
6.1k points