1 #include <iostream>
2 #include <fstream>
3 using namespace std;
4
5 int main()
6 {
7 fstream salesFile;
8 salesFile.open("sales.txt", ios::in);
9
10
11 {
12 cout << "The file sales.txt does not exist.\n";
13 }
14 else
15 {
16 salesFile.close();
17 cout << "The file sales.txt already exists.\n";
18 }
19
20 return 0;
21 }
Select the statement that should appear in line 10 for the program to
correctly report whether the sales.txt file exists.
if (salesFile.fail())
if (salesFile.fail())
if (salesFile.exists())
if (!exists(salesFile))