Write a C++ program that reads text from one file and writes an edited version of the same text to another file. The edited version is identical to the un- edited version except that every string of two or more consecutive blanks is replaced by a single blank. Thus, the text is edited to remove any extra blank characters. Your program should define a function that is called with the input- and output-file streams as arguments. If this is being done as a class assignment, obtain the file names from your instructor. Solution #include<iostream> #include<fstream> #include<string> using namespace std; int main() { string line; string output; int check = 0; ifstream myfile (\"ganga.txt\"); ofstream ofut; ofut.open(\"out.txt\"); if(myfile.is_open()) { while(getline(myfile,line)) { output = \"\"; for(int i=0;i<line.length()-1;i++) { if(line[i] == \' \' ) check++; else if (line[i] != \' \') { if(check >= 1){ check = 0; output += \' \'; } output += line[i]; } } output+=\'\ \'; ofut<<output; } myfile.close(); ofut.close(); cout<<\"File Generated Succesfully\"; } else{ cout << \"Unable to open file\"; } return 0; } please delete the output file if exists while running the code. .