This is actually a combination of both unspecified behavior and undefined behavior.
It is unspecified because the order of evaluation of function arguments is not specified so in this line:
printf("%d%d%d",++a,a++,++a);
^ ^ ^ ^
1 2 3 4
we do not know which order functions arguments 1
to 4
will be evaluated and it is even possible that if this was in a loop that on subsequent executions the order could be different. This is covered in the C99 draft standard section 6.5.2.2
Function calls paragraph 10 which says(emphasis mine):
The order of evaluation of the function designator, the actual arguments, and
subexpressions within the actual arguments is unspecified, but there is a sequence point
before the actual call.
By itself this means the output of the program is unreliable but we also have undefined behavior due to the fact that the code above modifies a
multiple times within one sequence point. This is covered by section 6.5
Expressions paragraph 2 which says(emphasis mine):
Between the previous and next sequence point an object shall have its stored value
modified at most once by the evaluation of an expression.72) Furthermore, the prior value shall be read only to determine the value to be stored.73)
Undefined behavior means that anything could result from running this program including that it appears to work correctly, the term is defined in section 3.4.3
and includes the following note which explains the possible result of undefined behavior:
Possible undefined behavior ranges from ignoring the situation completely with unpredictable results, to behaving during translation or program execution in a documented manner characteristic of the environment (with or without the issuance of a diagnostic message), to terminating a translation or execution (with the issuance of a diagnostic message).
Beyond that even if you could obtain reliable results code like that is hard to read and would be a nightmare to maintain in a complex project. If there are alternative simpler ways to write the code that meets other requirements such as performance etc... then that is the approach you should take.