How to end a whole program
<p>I have a pretty simple C++ console program. It's working fine, but I have some issues. 
I have 2 functions. First function called "input" asks from user to input numbers from 6 to 10. In that function I declared:</p>

<pre><code>if ((a[i][j] &lt; 6) || (a[i][j] &gt; 10))
{
    cout&lt;&lt;"Invalid input!";
    return 0; 
}
</code></pre>

<p>Second function called "output", prints out those numbers from first function. </p>

<p>In the main it is like:</p>

<pre><code>int main ()
{
    ...
    input (matrix, number);
    output (matrix, nubmer);
}
</code></pre>

<p>My question is this. When I input number that isn't 6-10, my program still do "output" function, so it prints some random numbers. How can I break whole program in exact time when input rules are broken? Without any random output and stuff, just to print "Invalid output", then to start program from the start?</p>
