Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - main(){ unsigned int a; int b =- 1; a = b; printf("%u ",a); } The output result after the program runs is
main(){ unsigned int a; int b =- 1; a = b; printf("%u ",a); } The output result after the program runs is
The answer is the maximum true value that your machine can express in int-1

A normal 32-bit computer can represent 4294967296 numbers, so the answer is 4294967295.

You should choose B for this question. It should be an old problem (probably tested on TC2.0).

The explanation is as follows: b=- 1, which is a signed plastic variable; Is an unsigned integer variable. Assigning the value of a signed integer variable to an unsigned integer variable will cause an "overflow" (it is not actually an overflow, but it can be regarded as an overflow). This error occurs because most machines use complement to represent negative numbers. There are pictures and truth:

Satisfied with the adoption, not satisfied with it.