title: How to print a specific character from a string in C
body: <p>I'm recently practicing looping. I learned how to print: for example <code>home</code> to <code>h</code> <code>ho</code> <code>hom</code> <code>home</code>. by using</p>
  <pre class="lang-c prettyprint-override"><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  int main (){
      char s[100];
      
      printf(&quot;Input string = &quot;);
      scanf(&quot;%[^\n]&quot;, s);
      
      for (int i=1; i&lt;=strlen(s); i++){
          for(int j = 0; j&lt;i; j++)
          printf(&quot;%c&quot;, s[j]);
          printf(&quot;\n&quot;);
      }
  
      return 0;
  </code></pre>
  <p>How can i reverse it so it can be
  <code>home</code>
  <code>hom</code>
  <code>ho</code>
  <code>h</code>
  instead? thank you.</p>