title: time limit in C Language - A Quiz Program
body: <p>I've the Code as below for a Quiz Program, for which I'm in need of adding a time limit. Right now, the code performs the quiz score based on time used. But I want it to exit in 5 minutes exactly from the time when the program started. </p>
  
  <p>Header used</p>
  
  <pre><code>#include&lt;time.h&gt;
  </code></pre>
  
  <p>Initialized values as follows</p>
  
  <pre><code>time_t initialtime,finaltime;
  </code></pre>
  
  <p>I start the time count before the quiz starts using this code</p>
  
  <pre><code>initialtime=time(NULL);
  </code></pre>
  
  <p>When the program ends, I get the time by this code</p>
  
  <pre><code>finaltime=time(NULL);
  </code></pre>
  
  <p>Now, How do I end the program before the final time reaches 10 minutes ? What code should I use in the Main function ?</p>
  
  <p><strong>PS: I can post the full code if required.</strong> </p>