<!-- PDF page 73 -->

An expression using **AND** or **OR** like this is called a *conditional expression*.

An example using **OR** could be:

```
price=price_less_tax*(1.15 OR v$="zero
rated")
```

Notice how **AND** tends to go with addition (because its default value is **0**), and **OR** tends to go with multiplication (because its default value is **1**).

You can also make string valued conditional expressions, but only using **AND**.

<table>
<tbody>
<tr><td rowspan="2"><strong>x$ AND y</strong> has the value</td><td rowspan="2">{</td><td><strong>x$</strong> if <em>y</em> is non-zero</td></tr>
<tr><td>"" if <em>y</em> is zero</td></tr>
</tbody>
</table>

So it means **x$ if y** (else the empty string).

Try this program, which inputs two strings and puts them in alphabetical order:

```
10 INPUT "Type in two
   strings"'a$,b$
20 IF a$>b$ THEN
   c$=a$:a$=b$:b$=c$
30 PRINT a$;" ";("<" AND a$
   <b$)+("=" AND a$=b$);
   " ";b$
40 GO TO 10
```

### Exercise

1. *NextBASIC* can sometimes work along different lines from English. Consider, for instance, the English clause *If a doesn't equal b or c*. How would you write this in *NextBASIC*? The answer is not:

   ```
   IF a<>b OR c
   ```

   nor is it

   ```
   IF a<>b OR a<>c
   ```

