title: Write to file instead of stdout
body: <p>I am writing a program in C.This program prints out the files present in current directory.
  I want the output in some text file not on the console.
  my program is:-</p>
  
  <pre><code>int main()
  {
  
          system("ls");
          return 0;
  }
  </code></pre>
  
  <p>Thanks in advance!!!</p>