title: I want to change the output value of the string
body: <pre><code>#include &lt;stdio.h&gt;
  int main() {
      char str[101];
      int i;
      int j=1;
      scanf("%s", str);
      for(i=0; str[i]!='\0'; i++) {
          if(i!=0 &amp;&amp; i%j==0) {
              printf("\n");
              j++;
          }
          printf("%c", str[i]);
      }
  }
  </code></pre>
  
  <p>If I input "abcdefg" in this code, I want it printed in turn like stairs.
  a(\n)
  bc(\n)
  def(\n)
  g
  How fix code?</p>