title: Need to add a loop to exit or repeat in C++
body: <p>I want to make a code that asks user for input either to quit or repeat. I am not getting the desired output.</p>
  
  <pre><code>int main()
  {
      char yes,yn;
      do
      {
          cout &lt;&lt; "Hello world!" &lt;&lt; endl;
          while(yn != 'y' || yn != 'Y' || yn != 'n' || yn != 'N')
          {
              cout&lt;&lt;"enter (Y/N): ";
              cin&gt;&gt;yes;
              yn = yes;
          }
      }while(yn == 'y' || yn == 'Y');
  }
  </code></pre>
  
  <p>Program asks for user input, when I input "Y,y,N or n", it should get out of the loop and then decide whether exit or repeat. But it isn't getting out of the loop and asking me for input again and again. I am not getting what is stopping to get out of the loop.</p>