Given a file named execution.log write the necessary code to add the line “Program Execution Successful” to the end of the file.

LANGUAGE: C++

CHALLENGE:

Given a file named execution.log write the necessary code to add the line “Program Execution Successful” to the end of the file.

SOLUTION:



ofstream e_Log;
e_Log.open("execution.log", ios::app);

e_Log << "Program Execution Successful";
e_Log.close()