How to solve this problem without the use of if-else statements?
<p>I have just started my C++ lecture class. And the teacher has given us the following assignment.</p>

<blockquote>
  <p>Write a program that determines whether a number is even or odd.</p>
</blockquote>

<p>The logic I would use for the program is.</p>

<ol>
<li>Get input <code>a</code>.</li>
<li>Store <code>a % 2</code> as <code>b</code>.</li>
<li>If <code>b</code> is 0, then <code>a</code> is even, else <code>a</code> is odd.</li>
</ol>

<p>The catch though, is that we have to write the program without the use of a <code>if-else</code> statement.</p>

<p>I have been thinking on how to approach the problem for the past few hours, but I have no clue what to do. Any hints or suggestions?</p>
