326 views
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;
}

Please log in or register to answer this question.

Related questions

1 votes
1 votes
0 answers
3
Na462 asked Aug 6, 2018
1,034 views
3 votes
3 votes
1 answer
4
Hardik Vagadia asked Dec 30, 2016
1,996 views
Is 2's complement code weighted or unweighted? Why?