Because it 050is considered octal, but 50considered decimal.
So x = 050basically means x = 40.
6.4.4.1/3
A decimal constant begins with a non-zero digit and consists of a sequence of decimal digits. The octal constant consists of pre fi x 0 optionally followed by only a sequence of digits from 0 to 7.
source
share