I am coding in C and running the programs in a Linux terminal. I want to save the output of the program in a .txt file. I usually do this by executing ./a.out>filename.txt
But I have written an interactive program in which I have to enter a number to initiate the program. In that case how do I do it?
Thanks a lot and your valuable suggestions are most welcomed.