0 votes 0 votes How is the output still -4? when we are storing it in an unsigned int here shouldn’t it be converted to 2’s complement and then the absolute value of it be the result? int main() { unsigned int num = -4; printf("%d", num); return 0; } Programming in C number-representation programming-in-c + – shaz asked Dec 13, 2018 shaz 328 views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply Mk Utkarsh commented Dec 13, 2018 reply Follow Share you are defining num as unsigned int but you are using format specifier for signed int %d #include <stdio.h> int main() { unsigned int num = -4; printf("%u", num); return 0; } Is the code which will give output as 4294967292. $ \ \ \ (2^{32} - 4)$ 2 votes 2 votes shaz commented Dec 13, 2018 reply Follow Share Aha! Got it thanks! 0 votes 0 votes Please log in or register to add a comment.