by robertlagrant · 2y ago · 0 comments
#include <stdio.h>
int main(void) {
unsigned int positive_number = -1;
printf("%d", positive_number);
return 0;
}
Prints -1.And printing it as %d is technically a misuse of printf, since %d means print as a signed integer. If you did %u (print as unsigned integer) instead you'd see the value is really 4,294,967,295 (again, platform dependant)