title: Find all substrings of a string
body: <p>I have a string where I need to do substring operation.  I'm trying to achieve something like this for example if the input string is <code>com</code> then the output must be something like this - </p>
  
  <p><code>c</code> 
  <code>co</code> 
  <code>com</code> 
  <code>o</code>
   <code>om</code>
   <code>m</code>.. I have tried this </p>
  
  <pre><code>for(int i=0 ; i&lt;len ;i++)
  {
      printf("%s",&amp;string[strlen(string)-i]));
  }
  </code></pre>