#include&lt;iostream&gt;    #include &lt;fstream&gt;    using namespace std;    int main &#40;&#41;     &#123;        ofstream outfile &#40;&quot;test.txt&quot;&#41;;        for &#40;int n = 0; n &lt; 100; n++&#41;        &#123;            outfile &lt;&lt; n;            outfile.flush&#40;&#41;;        &#125;        cout &lt;&lt; &quot;Done&quot;;        outfile.close&#40;&#41;;        return 0;    &#125;
A. Done
B. Error
C. Runtime error
D. None of the mentioned
Answer:A
#include&lt;iostream&gt;    #include &lt;fstream&gt;    using namespace std;    int main &#40;&#41;     &#123;        ofstream outfile &#40;&quot;test.txt&quot;&#41;;        for &#40;int n = 0; n &lt; 100; n++&#41;        &#123;            outfile &lt;&lt; n;            outfile.flush&#40;&#41;;        &#125;        cout &lt;&lt; &quot;Done&quot;;        outfile.close&#40;&#41;;        return 0;    &#125;
A. Done B. Error C. Runtime error D. None of the mentioned
Explanation:In this program, We are using the flush function to update the contents in a file.