What will the line of code below print out and why?
#include <iostream>
int main() {
std::cout << 25u - 50 << '\n';
}Show answer and explanation
25u - 50 is evaluated as unsigned arithmetic because the signed operand converts to unsigned. The result wraps modulo UINT_MAX + 1, yielding UINT_MAX - 24—4294967271 only on a 32-bit unsigned int.
25u - 50 is evaluated as unsigned arithmetic because the signed operand converts to unsigned. The result wraps modulo UINT_MAX + 1, yielding UINT_MAX - 24—4294967271 only on a 32-bit unsigned int.
Connect the conclusion directly to the type, lifetime, ownership, overload-resolution rule, or library contract present in the question. State implementation dependence or a violated precondition explicitly instead of merely guessing output.