To append data onto the end of a text file, choose the correct option:

A. Use the `AppendStream` class
B. Add the `Append` argument to the constructor for the `FileStream` class
C. Add the `Append` argument to the constructor for the `StreamWriter` class
D. Add `true` as the second argument (Append) to the `StreamWriter` class
E. Open the file in append mode by adding an 'a' onto the end of the identifier

Answer :

d. add true as the second argument (Append) to the StreamWriter class. To append data to a text file, add 'true' as the second argument to the StreamWriter class in C#. This opens the file in append mode.

To append data onto the end of a text file, the correct answer is to add true as the second argument (Append) to the StreamWriter class. This option ensures that data is appended rather than overwriting the existing contents of the file.

For example, in C#, you would use:

StreamWriter sw = new StreamWriter("file.txt", true);

This method opens the file in an append mode, allowing you to add new data to the end of the file.