Output.txt -

: Declare a FILE pointer and use fopen with the "w" mode, then write using fprintf .

: Use fopen('output.txt', 'w') followed by fprintf to save your results to a text file. Command Line Redirection output.txt

: Open Notepad , type your text, and select File > Save As , naming it output.txt . : Declare a FILE pointer and use fopen