Unknown behaviour of OR operator in C++ : <p>I have this code running by chance and when i put anything as the answer it is showing me correct. I know we have to put ans before YES and yay, but this code was compiled too, as i mentioned if i put any word as the input the output is correct:</p>

<pre><code>string ans;
cin &gt;&gt; ans;

if(ans == "yes" || "YES" || "yay") {
    cout &lt;&lt; "Correct";
}else {
    cout &lt;&lt; "Incorrect";
}
</code></pre>
