It is possible, but you need to check your specific compiler documentation or the stdio.h file, because you'll need to implement the code in a specific
function like putchar. For example, for IAR compiler, you can see it in this thread how to use printf to send the data to the serial port. In your case, you'd need to adapt the putchar function to send data to your LCD.
I'm not familiar with other compilers so I can't tell you how to do it, but the principle that i mentioned above is similar for all compilers.