Not getting some items from the list
<p>Hi I have the following code for searching students ID from a list after adding a student. The first time I fetch for it, it works normally but when I add another student and search for that particular ID I don't find it. Can someone tell me where is the mistake?</p>

<pre><code>public void AddMarks(int id)
{
    for (int i = 0; i &lt; mystudent.Count; i++)
    {
        if (mystudent[i].Id == id)
        {
            foreach (Student st in mystudent)
            {
                 Console.WriteLine("enter Mathematics halfyearly exam");
                 Maths.HYEXAM = Int16.Parse(Console.ReadLine());
                 Console.WriteLine("enter Mathematics annualyear exam");
                 Maths.ANEXAM = Int16.Parse(Console.ReadLine());
            }
        }
    }
}
</code></pre>
