Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Main(){ int x = 023; in C program; printf("%d ",-x); What's x? Why?
Main(){ int x = 023; in C program; printf("%d ",-x); What's x? Why?
The output result is 18.

First: the sentence int x = 023 023 is an octal number, which is converted into 10, which is 19.

Then: -x, 19- 1= 18.

The code used for verification is as follows:

# include & ltstdio.h & gt

main()? {

int? x = 023

printf("%d ",-x);

} The verification results are as follows: