input 1D array into 2D array in increasing order (C)
<p>I need to build a program, that requesting from user to insert a sentence
like "Hello World" or whatever</p>

<p>and than take this sentence and input it inside 1D array</p>

<p>and from there to input it in 2D array that will present his sentence in this order:</p>

<pre><code>Hello!! :)
)Hello!! :
:)Hello!! 
 :)Hello!!
! :)Hello!
!! :)Hello
o!! :)Hell
lo!! :)Hel
llo!! :)He
ello!! :)H
</code></pre>

<p>I did most of the job done, but i can't make it exactly like this
i mean
its present me the sentence decreasing and not increasing</p>

<p>my code:</p>

<pre><code>#include &lt;stdio.h&gt;
#define P 10
int main(int argc, const char * argv[])
{
    char array1[P][P];
    char array2[P];
    int i, j;

    for (i = 0; i&lt;P; i++) //fill the array with the chars.
    {
        scanf("%c", &amp;array2[i]);
    }

    for (i=0 ; i&lt;P ; i++)
    {
        for (j=0 ; j&lt;P ; j++)
        {
            array1[i][j] = array2[j+i];
        }
    }

    for (i=0 ; i&lt;P ; i++)
    {
        for (j=0 ; j&lt;P ; j++)
        {
            printf("%c", array1[i][j]);
        }
        putchar('\n');
    }

}
</code></pre>

<p>where is my mistake? and how i can fix it?
Thanks.</p>