title: How to display one result in for loop
body: <p>I've this program that is dealing with registration on seminar.</p>
  
  <p>I'v managed to do up the struct class, and also able to list out the seminar.
  Currently, I have an issue with the registration.
  The problem goes like this:
  The user would input the seminar that he would like to register for.
  Once the user registered the seminar, it will result that the seminar is either registered successfully (if there's slot), or unsuccessfully (if all slot are taken).</p>
  
  <p>The code that I have is able to print out the result, however it display all the result that it loop through. Is there a way for me to print the result just for that particular seminar that the user had input?</p>
  
  <p>Below is my code.
  I understand that I did a for loop.
  But I'm not too sure how I can display a single result, without looping it.</p>
  
  <p>Struct:</p>
  
  <pre><code>     struct Seminar
          {
              string Title;
              int Capacity;
          };
  Seminar theSeminar[4];
  </code></pre>
  
  <p>function:</p>
  
  <pre><code>void registerSem(string sem){
  
      for (int i = 0; i &lt; 4; i++)
      {
         if( theSeminar[i].Title == sem){
              if (theSeminar[i].Capacity &gt; 0)
              {
                  theSeminar[i].Capacity = theSeminar[i].Capacity - 1;
                  cout &lt;&lt; "Successful registered!" &lt;&lt; endl;
  
              }
              else{
                  cout &lt;&lt; "Unsuccessful registration" &lt;&lt; endl;
              }
         }
         else{
             cout &lt;&lt; "Not Found" &lt;&lt; endl;
         }
      }
  }
  </code></pre>