is it possible to write a C program that can input text into other programs?

Eg. i have a program that generates random number chains, and i want it to be able to put the text into an application like notepad or word. but i want this to happen in real-time, not saving the text into a .txt file