title: C run external program and get the result
body: <p>In C, how should I execute external program and get its results as if it was ran in the console?</p>
  
  <p>if there is an executable called dummy, and it displays 4 digit number in command prompt when executed, I want to know how to run that executable and get the 4 digit number that it had generated. In C.</p>