The prime BASIC program calculates the next higher and lower prime number from a specified number.

prime {number}

number |
If a prime number is not provided with the command, the program requests it. |

prime 1313 is a prime number the next highest prime number is = 17 the next lowest prime number is = 11

prime 14the next highest prime number is = 17 the next lowest prime number is = 13

primePRIME - computes the next greater prime number Enter a positive integer =1313 is a prime number the next highest prime number is = 17 the next lowest prime number is = 11