Vidyalelo
C++ Programming · Q465

C++ miscellaneous

Programming · C++ Programming · question 465

Q465

What is the output of this C++ program in the "test.txt" file? #include using namespace std; int main () long pos; ofstream outfile; outfile.open ("test.txt"); outfile.write ("This is an apple",16); pos = outfile.tellp(); outfile.seekp (pos - 7); outfile.write (" sam", 4); outfile.close(); return 0;

A.
This is an apple
B.
apple
C.
sample
D.
This is a sample
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board