199k views
3 votes
Assuming outFile is a file stream object and number is a variable, which statement writes the contents of number to the file associated with outFile?

number >> outFile;
outFile << number;
outFile >> number;
write(outFile, number);

User Satnhak
by
5.9k points

1 Answer

5 votes

Answer:

Its outfile<<number.

However, before this we need to write

outfile.open("xyz.txt", ios;;out)

outfile<<number

And this code will do what is required in the question. This is going to write the number's content to the xyz.txt file which is the file associated with the outfile.

And remember this is in C++. And C++ is a imperative oriented programming language. Undoubtedly, Python and R are fully object oriented programming languages.

Step-by-step explanation:

The answer is self explanatory.