title: How Ctrl Z works actually
body: <p>Just for curious mind. During problem solving many question says,"Input will be terminated by <kbd>Ctrl</kbd>+<kbd>z</kbd>". I know its "EOF(End Of File)" But...</p>
  
  <pre><code>while(scanf("%d",&amp;a)==1)
  { cout&lt;&lt;"OK"&lt;&lt;endl;}
  
  while(scanf("%d",&amp;a)!=EOF)
  {cout&lt;&lt;"OK"&lt;&lt;endl;}
  
  while(cin&gt;&gt;a)
  {cout&lt;&lt;"OK"&lt;&lt;endl;}
  </code></pre>
  
  <p>Above 3 will be terminated by <kbd>Ctrl</kbd>+<kbd>z</kbd>.</p>
  
  <pre><code>while(scanf("%d",&amp;a))
  {cout&lt;&lt;"OK"&lt;&lt;endl;}
  </code></pre>
  
  <p>It will give OK by pressing <kbd>Ctrl</kbd>+<kbd>z</kbd>.
      and</p>
  
  <pre><code>while(1){cin&gt;&gt;a;
  cout&lt;&lt;"OK"&lt;&lt;endl;}
  </code></pre>
  
  <p>Its a infinte loop.</p>
  
  <p>I want to know how <kbd>Ctrl</kbd>+<kbd>z</kbd> works on a program termination. What is the reason behind it. Please answer in details.</p>