1) Write a program in any language like C, C++, java. 2) And redirect the output or error to a new file.