Not quite sure what you mean, but if you want to force the Command Prompt to stay open until you press a key, append these lines to your code.
Code:
#include <stdlib.h>
int main() {
/* code code code... */
system("pause");
return 0;
}
Or if you want to redirect your program's output to file called, say, "OUTPUT.TXT", write a batch file.
Code:
/path/to/exe/file/prog.exe > OUTPUT.TXT
Then, just double-click on your batch file to execute the program at C:\path\to\exe\file\prog.exe and your output will be written to C:\path\to\exe\file\OUTPUT.TXT, if not ./OUTPUT.TXT.