How to stop the cycle after mistake
<p>I want to do only the one thing in that cycle ... - the IF or the ELSE .. (when its true and false ofc as you know it ..) If i have two typed students with their information and my first student in group 1 is not with an excellent grade and the second one student is with excellent grade my program prints:
1)first loop on for:it;s false so it makes the else 
2)second loop on for: it's true so it makes the if</p>

<p>and i have:
No information
Student with excellent grade...</p>

<p>I want to see only the students with excellent grade (if i use BREAK; i will stop the FOR cycle) Here is my code: </p>

<pre><code>int gr;
cout&lt;&lt;"Enter group that you want to check: ";cin&gt;&gt;gr;
cout&lt;&lt;"Students with excellent grade in group "&lt;&lt;gr&lt;&lt;":\n";
    for(i=0;i&lt;n;i++)
        {
            if(m[i][2]==gr &amp;&amp; m[i][3]&gt;=5.500)
            {
                for(j=0;j&lt;4;j++)
                    cout&lt;&lt;setprecision(8)&lt;&lt;m[i][j]&lt;&lt;"\t";
            }
            else
                    cout&lt;&lt;"No students with excellent grade in this group"&lt;&lt;endl;

        }
</code></pre>

<p>I have the same problem here. Can i use the "bool" type and how in that code(code is based on struct):</p>

<pre><code>int x;
bool no_info=false;
p: cout&lt;&lt;"| What personal id you want to search for: ";cin&gt;&gt;x;

for(int i=0;i&lt;n;i++)
{
  if(pov[i].id==x)
  {
    no_info=true;
    cout&lt;&lt;pov[i].id&lt;&lt;endl;
    cout&lt;&lt;pov[i].name&lt;&lt;endl;
    cout&lt;&lt;pov[i].lastname&lt;&lt;endl;
    cout&lt;&lt;pov[i].department&lt;&lt;endl;
    cout&lt;&lt;pov[i].salary&lt;&lt;endl;
  }
}
  if(no_info){
   cout&lt;&lt;"No information"&lt;&lt;endl;}
 goto p;
</code></pre>

<p><strong>EDITED!!!</strong></p>
