128. Arithmetic Edge Cases-II

Question.1

A function returns -1 as an error code. The caller stores it in an unsigned variable:

int get_sensor() { return -1; }  // Error

uint8_t reading = get_sensor();
if (reading == -1) {
   printf("Error");
} else {
   printf("Value: %u", reading);
}

What is the output?

Need Help? Refer to the Quick Guide below

Select Answer