title: Get Keyboard Interrupt in C
body: <p>Program:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  void main()
  {
      int time=1800;
      while(1){
          system("clear");
          time-=1;
          printf("%d\n",time);
          sleep(1);
      if(time==0)
          pause();
      }
  }
  </code></pre>
  
  <p>The above program stops when the time reaches 0. My requirement is during the runtime of the program, If I press any key like spacebar or any other key, the program gets paused and once again I press the key, the program gets resumed. So for doing this, before execution of 
  while condition, we submit the signal handler for keyboard interrupt. In C how to do this. </p>
  
  <p>What is the function used to get keyboard interrupt. I dont want to get input from the user, I want to handle the interrupt generated by the user through keyboard.</p>
  
  <p>Thanks in Advance..,</p>