sprintf(...) writes data to the character array whereas printf(...) writes data to the standard output device.
Compilation How to reduce a final size of executable?
Size of the final executable can be reduced using dynamic linking for libraries.