qbasic.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
MOD Arithmetic Operator
  Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
Divides one number by another and returns the remainder.
 
numeric-expression1 MOD numeric-expression2
 
    ■ numeric-expression1    Any numeric expressions. Real numbers are
      numeric-expression2    rounded to integers.
 
Example:
    PRINT 19 MOD 6.7    'QBasic rounds 6.7 to 7, then divides.
                        'Output is:  5