Why the compiler comprehend the comma as an operator?
Because it can be an operator. What does the comma operator , do? In your case you have the argument list to printf separated by commas - those are not operators as such but part of the function call syntax. But the commas inside each parenthesis is the comma operator.
this program showed me an unexpected result.
There is no expected result - you are invoking both undefined and unspecified behavior.
Each sub-expression (temp = inp / ..., inp %= ..., temp)
is sequenced from left to right, as guaranteed by the comma operator. But the two sub-expressions aren't sequenced in relation to each other: the order of evaluation of function arguments is unspecified.
Furthermore, there is no sequence point between the temp = inp...
expression of each subexpression and the right-most value computation of temp
in the other expression, meaning that the code invokes undefined behavior. And that's why your second example works, it has the poorly-defined behavior removed.
Do not mix over ten(!) operators and four(!) side-effects in the same expression. That's plain obfuscation. Instead rewrite it as readable, well-defined C:
int inp, result1, result2;
inp = 2347653;
result1 = inp / 10000;
inp %= 10000;
result2 = inp / 1000;
inp %= 1000;
printf("%d, %d", result1, result2);