Operators

Top  Previous  Next

Arithmetic operators

Tibbo BASIC

+

-

*

/

mod

Tibbo C

+

-

*

/

%

 

Tibbo BASIC:

Tibbo C:

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

x=y % 2;

 

String operators

Tibbo BASIC

+

Tibbo C

+

 

Here, "+" means concatenation:

 

Tibbo BASIC:

Tibbo C:

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

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:

Tibbo C:

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

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:

Tibbo C:

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

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