Prime or Not


Goal:

Ask the user for a number, then tell them if the number is prime! A prime number is a number that is only divisible by 1 and itself.

Steps:

  1. Ask the user for a number (JOptionPane).
  2. Use a for loop, if statement, and modulo to find if the number is prime.
  3. If the number is divisible by any number other than 1 or itself, the number is not prime.