title: How to print out a string in uppercase/lowercase letters strictly using the fgets function?
body: <p>Here is my code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;ctype.h&gt;
  #include &lt;string.h&gt;
  
  int main()
  {
      FILE *fp;
      char s[50];
      fp = fopen("line.txt" , "r");
  
      if( fgets (s, 50, fp)!=NULL ) 
     {
        puts(s);
     }
     fclose(fp);
  
    return 0;
  }
  </code></pre>
  
  <p>I know how to display a string  in all uppercase and lowercase letters using the printf function. But I don't know how to do it using the fgets function. I am reading a string in from a file too, so thats the tricky thing for me.</p>