title: In C, I wrote a program to call an exe using system(). The exe asks for user input. How can I make my program provide the input?
body: <p>I've seen posts that are like this, but I couldn't find the exact answer to my question.
  I wrote a program in C that calls another exe I wrote by saying <code>system("./program_name");</code>. The program that is called asks for user input, and based on what is input, displays one of three strings to the screen.</p>
  
  <p>Once <code>system("./program_name");</code> runs the program, is there some way I can also make my program provide the input? I want this program to be able to run the other one multiple times, by providing different inputs each time. Then, I would like the program to display which inputs caused string 2 to be output.</p>
  
  <p>In other words, program 1 asks for input and displays String A, B, or C.
  Program 2 runs program 1 several times with different inputs, and displays which inputs resulted in String B.</p>
  
  <p>I'm stuck on being able to provide the input from my program.</p>
  
  <p>Thanks in advance for your help!! :)</p>