title: C program to display words to end with 'ent' from a txt file
body: <p>Hello i have being trying to count then display the words that end with 'ent' from a file and tried to do that using the following code but i couldn't even count them.
  this is the function i tried to use to count the words it is supposed to read text from a file then count and display to the terminal the words that end with 'ent'.
  please help me achieve that if you have an idea how to do it.</p>
  <pre><code>void ent(FILE*output){
      char s[250];
      int ent, i;
      output = fopen(&quot;output.txt&quot;, &quot;r&quot;);
      while(fgets(s, 250, output)){
          if((s[i]=='e') &amp;&amp; (s[i+1]=='n' )&amp;&amp; (s[i+2]=='t')){
              ent++;
          }
      }
      printf(&quot;le nbr de mots avec ent est: %d\n&quot;,ent);
      fclose(output);
  }
  </code></pre>