I'd guess you're doing this on Windows.
Since you opened the file in translated (text) mode, new-lines are converted to a carriage-return/line-feed pairs. The character code 10 happens to be treated as a new-line, so you end up with an extra byte compared to what you wrote.
If you open the file in binary mode instead, this won't happen.
FILE *fp = fopen( "123.txt", "wb" );
Note the b
added to the open mode-string.