title: why does my program quit after while loop?
body: <pre><code>// ConsoleApplication2.cpp : Defines the entry point for the console application.
  
  //
  
  #include "stdafx.h"
  #include &lt;iomanip&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  int main()
  {
      int n; // sportsmans number
      int kartai=0; // kartai - times
      int t=0; // how many points sportsman gets
      int tMin=0, tMax=0; // smallest and biggest points
      cout &lt;&lt; "Parasykite kiek isviso sportininku dalyvavo" &lt;&lt; endl; //Inputing how many sportsman played
      cin &gt;&gt; n;                                                      //
      while (kartai &lt; n) {
          cout &lt;&lt; "irasykite kiek tasku sportininkai gavo"; // inputing how many points sportsmans got
          cin &gt;&gt; t;
          if (kartai == 0) {
              t = tMin;
              t = tMax;
          }
          else
          {
              if (t &gt; tMax)
                  tMax = t;
              else if (t &lt; tMin)
                  tMin = t;
          }
          kartai++;
      }
      cout &lt;&lt; "didziausias skaicius buvo" &lt;&lt; tMax &lt;&lt; endl; // biggest score
      cout &lt;&lt; "maziausias skaicius buvo" &lt;&lt; tMin &lt;&lt; endl; // smallest score
  }
  </code></pre>
  
  <p>So after putting all how many points sportsmens gots in <code>while</code> loop, program quits never putting maximum and minimum points, nor does show any cout after while</p>