Home » C++ Programming » File Handling :: Discussion
Discussion :: File Handling - Section 1
  1. What will be the output of the following program?

    Note:Includes all required header files
    using namespace std;
    int main()
    {
       ofstream ofile;
       ofile.open ("find.txt");
       ofile << "letsfindcourse" << endl;
       cout << "Data written to file" << endl;
       ofile.close();
       return 0;
    }  
  2. A.
    Compile error
    B.
    Runtime error
    C.
    The program prints ""letsfindcourse"" in the file find.txt
    D.
    none of the above

    view answer View Answer

    discussion Workspace


Be The First To Comment