How to access files that were created using a program in second program?

I have created a program that takes input from the user and then perform operations and stores the result in a text file. I want to printg the contents of the file (file’s data that I have created using completely different program) using the the new program. So basically my idea is to create two programs one for input and second for output, is this possible? I tried to access the file using second program but the file pointer is returning NULL value? Please let me know my idea is logical or not. By the way I use replit app to code and I do coding in mobile phone. The language I am using is C.