title: Print a string till a particular character comes
body: <p>I want the string to be printed till character ('e') comes.<br>
  Code which I tried:-</p>
  
  <pre><code>#include &lt;stdio.h&gt;
      int main() {
      int a,i,x;
      char b[10];
      char ch;
      //enter input string
      for(i=0;i&lt;10;i++)
        scanf("%c",&amp;b[i]);
  
      for(i=0;i&lt;10;i++)
         if(b[i]!='e')
             printf("%c",b[i]); 
  
      return 0;
      }
  </code></pre>
  
  <p><code>Input:abcdefghij</code> <br>
  <code>Actual output:abcdfghij</code> <br>
  <code>Desired output:abcd</code> <br>
  <code>Question :</code> Where am I wrong ?  Will putting a <code>break</code> inside <code>if block</code> work here?</p>