title: How to suppress prompt and supply an input therafter
body: <p>I am not sure how to phrase this. But I have a C Program that will call another C Program in unix. After the call, the program(foo-exe) will prompt for an input "Y/N". I would like to suppress(hide) this prompting message and enter 'Y' thereafter as input. How do I go about doing that?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main(int argc, char* argv[])
  {
      system("/home/xyz/foo-exe bar");
  }
  </code></pre>
  
  <p>foo-exe</p>
  
  <pre><code>// do some other stuff
  char ans = 'n';
  printf("prompt message. Yes or no? (Y/N) ");
  ans=getchar();
  if(ans == 'Y') system("foo");
  </code></pre>