Which of the following writes the contents of the city and state variables to an output file

Question:

Which of the following writes the contents of the city and state variables to an output file named address.txt? The file is associated with the outFile object. 

a. address.txt << city << state << endl; 

b. ofstream << city << state << endl; 

c. outFile >> city >> state >> endl; 

d. outFile << city << '#' << state << endl;

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: