Multiple condition clause in C/ C++
<p>My aim is to get two numbers and perform an corresponding to the values they hold:</p>

<p>For ex.. Let the vars be <strong>x</strong> and <strong>y</strong>.</p>

<p>I need to compute the value of another var <strong>z</strong>, as follows:</p>

<p><strong>z</strong> = <strong>x</strong> + <strong>y</strong> // if <strong>x</strong> = <strong>y</strong> = 1</p>

<p><strong>z</strong> = <strong>x</strong> - <strong>y</strong> // if <strong>x</strong> = 0 and <strong>y</strong> = 1</p>

<p>Since i need to use it several times, it would not be efficient to use if else within a loop.</p>

<p>What i basically require is like a macro.... preferably using #define., like if it were to be used once:</p>

<p><strong>#define x + y 1</strong> replaces x+y with 1, but does not depend on the values of <strong>x</strong> and/or <strong>y</strong></p>

<p>Is there any way I could replace  x+y with 1, x-y with 0 and so on...</p>
