How to find the maximal (longest) sequence of increasing elements in an array arr[n]?
<p>I need to write a program, which finds the maximal sequence of increasing elements in an array arr[n]. It is not necessary the elements to be consecutively placed. E.g.: {9, 6, 2, 7, 4, 7, 6, 5, 8, 4} -> {2, 4, 6, 8}. 
I have some guidelines to use 2 nested loops and one additional array.
So far i know how to use if statements, loops and little arrays.
Any suggestions pls...?
This is my start so far (am I on a good track?): </p>

<pre><code>        Console.Write("Elements in array: ");
        int n = int.Parse(Console.ReadLine());
        int[] arr = new int[n];
        int[] result;

        for (int index = 0; index &lt; arr.Length; index++)
        {
            Console.Write("Array [{0}] = ", index);
            arr[index] = int.Parse(Console.ReadLine());
        }

        for (int indexOut = 0; indexOut &lt; n; indexOut++)
        {
            for (int indexIn = 1; indexIn &lt; n; indexIn++)
            {

            }
        }            
</code></pre>