title: Stop Code in C++
body: <p>How do you stop the code from running in C++? I have the code </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cmath&gt;
  using namespace std;
  int main() {
      int total, sub, subc;
      cout &lt;&lt; "What number would you like to start with? ";
      cin &gt;&gt; total;
          cout &lt;&lt; "Enter in a number, 1 or 2, to subtract";
      cin &gt;&gt; sub;
      if (sub == 1) {
          total--;
          subc++;
          cout &lt;&lt; "You subtracted one";
      }
      else {
          total = total - 2;
          subc++;
      }
      if (sub &lt;= 0)
          cout &lt;&lt; "YAY!";
  }
  </code></pre>
  
  <p>and i want to insert a thing that just stops the code and exits right after <code>cout &lt;&lt; "YAY!"</code>
  how do i do that???</p>