title: How to change directory using a c program and display its directory
body: <p>I have tried using chdir and cd but and ran dir 
  but both displayed the directory of the folder/project folder i am in.
  Following is the source Code</p>
  
  <pre><code>system("chdir (C:/)");
  system("dir");
  </code></pre>
  
  <p>and this </p>
  
  <pre><code>system("chdir C:/");
  system("dir");
  </code></pre>
  
  <p>and this</p>
  
  <pre><code>system("cd C:/");
  system("dir");
  </code></pre>