My DNA analyzer is failing
<p>I had to make a DNA analyzer for class and it is making me some trouble.
Try inserting a long string and you will see it is making errors.
I was asked to find the sequence aaggg in a string that is inserted. Here is the code:</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
{
    static void Main(string[] args)
    {
        string dna;
        bool code = false;
        Console.WriteLine("Enter your desired DNA here");
        dna = Console.ReadLine();
        for (int a = 0; a &lt; dna.Length; a++)
        {
            if (dna[a] =='a')
            {
                if (dna[a + 1] == 'a')
                {
                    if (dna[a + 2] == 'g')
                    {
                        if (dna[a + 3] == 'g')
                        {
                            if (dna[a + 4] == 'g')
                            {
                                code = true;
                            }
                        }
                    }
                }
            }
        }
        if (code == true)
        {
            Console.WriteLine("The sequence aaggg appeared");
        }
        else
        {
            Console.WriteLine("Nope...");
        }
    }
}
}
</code></pre>
