# Operators

## Arithmetic operators

 Tibbo BASIC + - * / mod Tibbo C + - * / %

#### ** Tibbo Basic **

``````x=y mod 2 'modulus operation, i.e. 5 mod 2 = 1
``````

#### ** Tibbo C **

``````x=y % 2;
``````

## String operators

 Tibbo BASIC + Tibbo C +

Here, "+" means concatenation:

#### ** Tibbo Basic **

``````dim s as string="TIBBO"
s=s+" TECHNOLOGY" 'concatenation
``````

#### ** Tibbo C **

``````string s="TIBBO";
s=s+" TECHNOLOGY"; //concatenation
``````

## Relational and logic operators

Used in conditional expressions, which in turn are used in control structures.

 Tibbo BASIC > >= < <= = <> and or Tibbo C > >= < <= == != && ||

#### ** Tibbo Basic **

``````if x=0 and s<>"ABC" then...
``````

#### ** Tibbo C **

``````if(x==0 && s!="ABC"){...
``````

## Increment and decrement operators (Tibbo C only)

 Tibbo C ++ --

#### ** Tibbo C **

``````x++;
--x;
``````

## Bitwise operators

 Tibbo BASIC and or xor shl shr not Tibbo C & | ^ << >> ~

#### ** Tibbo Basic **

``````x=y and z
x=y or z
x=y xor z
x=y shl 2 'shift contents of y left by 2 bits
x=y shr z 'shift contents of y right by z number of bits
x=not y
``````

#### ** Tibbo C **

``````x=y & z;
x=y | z;
x=y ^ z;
x=y << 2;
x=y >> z;
x= ~ y;
``````

## Assignment operators (Tibbo C only)

 Tibbo C += -= *= /= %= <<= >>= &= |= ^=

#### ** Tibbo C **

``````x*=2;
y<<=z; //shift contents of y left by z number of bits
``````