Operator in QBASIC

An operator is a symbol which tells the computer to perform certain mathematical and logical calculation.

Types of operator

  1. Mathematical Operators
  2. Relational Operators
  3. Logical Operators
1. Mathematical Operators


Opetrator Meaning Example
+ addition 2+2
- subtraction 5+2
* multiplication 2*2
/ division 2/2
\ Integer division (It gives the integer value) 2\2
MOD modulus (It gives remainder) 3 MOD 2
^ exponent 2^2


2. Relational Operator


Opetrator Meaning Example
< less than 2<3  
> greater than 5>2
<= less than or equal to 2<=3
>= greater than or equal to 2>=2
= equal to 2=2
<> not equal to 3 <> 2
3. Logical Operator



Opetrator Meaning Example
AND Logical AND
OR Logical OR
NOT Logical NOT

Comments

CM said…
Interesting site I have just completed a change due to having trouble controlling too many legacy computers ( TRS80 16k was the first. QUICK BASIC IS NOW INSTALLED ON 2 GB
SD MINI chip and it runs fine on any computer with a USB to SD mic adapter. Lots of room left for all my legacy programs. By saving the programs as txt files I can browse thru program structure on my Kobo e-reader anywhere with my feet up.
CM:\Old Guy
CM said…
Interesting site I have just completed a change due to having trouble controlling too many legacy computers ( TRS80 16k was the first. QUICK BASIC IS NOW INSTALLED ON 2 GB
SD MINI chip and it runs fine on any computer with a USB to SD mic adapter. Lots of room left for all my legacy programs. By saving the programs as txt files I can browse thru program structure on my Kobo e-reader anywhere with my feet up.
CM:\Old Guy

Popular posts from this blog

input any string and reverse it, palindrome

PALINDROME AND ARMSTRONG PROGRAMS

N NE NEP NEPA NEPAL PATTERN