I am writing a code where I have to print the same data on the console and to a file. Is there a way to populate a common output stream object and then display it on console using cout and export it to a file, using fstream and iostream libraries?I am writing a code where I have to print the s