Create a linked list from space separated input
<p>I am trying to make a linked list from space separated integer input. </p>

<p>Input:</p>

<ol>
<li>Number of nodes</li>
<li>Space separated input</li>
</ol>

<p></p>

<pre><code>int main()
{
    int n;
    cout&lt;&lt;"Enter number of nodes";
    cin&gt;&gt;n;
    cout&lt;&lt;"\nEnter data"&lt;&lt;endl;
    int temp;
    lNode *head = NULL;
    while(cin&gt;&gt;temp)
    {
        CreateLinkedList(&amp;head,temp);
    }
    PrintLinkedList(head);

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

<p>Here I am not getting how to limit the user input to the number of nodes which he has given as first input. Is there any other way to get user input?</p>
