The implementation of C standard functions is obviously implementation specific. It only makes sense to ask about specific implementations.

For all we know, scanf() converts digits to integers by writing them on a card and passing it to a midget in a cedar chest, who computes the answer and delivers it via carrier pigeon.