Explain the Difference between an Overflow and an Underflow.
An overflow occurs when the result of an arithmetic operation, typically addition or multiplication, is larger than the maximum value that the data type can hold. For instance, if a variable can hold up to 255, and you add 1 to 255, it overflows and wraps to 0.
An underflow occurs when the result of a subtraction is smaller than the minimum value the data type can hold, which is typically zero for unsigned integers. Subtracting 1 from 0 causes an underflow and wraps to the maximum value.