recursive function calling itself even condition is satisfied
<p>i have a very simple code here which uses recursion to iterate the queue class i need to simple print 6 on screen but it print 1 ,please tell me where i am wrong.</p>

<pre><code>protected void Button1_Click(object sender, EventArgs e)
{
    q.Enqueue(1);
    q.Enqueue(2);
    q.Enqueue(3);
    q.Enqueue(4);
    q.Enqueue(5);
    q.Enqueue(6);

    long id = getID(Convert.ToInt64(q.Dequeue()));

    Response.Write(id);  

}

private long getID(long id)
{
    if (id == 6)
    {
        return id;
    }
    else
    {

        id = Convert.ToInt64(q.Dequeue());

        if (q.Count != 0)
        {
            getID(id);
        }
        else
        {

        }
    }

    return id;
}
</code></pre>

<p>}</p>
