Practice

Prime Number Checker

HARDAlgorithms

Read a positive integer N. Output Prime if N is a prime number, or Not Prime otherwise.

A prime number is a whole number greater than 1 that has no divisors other than 1 and itself.

Input: A positive integer N. Output: Prime or Not Prime.

Example:

Input:  7
Output: Prime

Sample Test Cases

Test 1: 7 is prime
Inputs: 7
Expected: Prime
Test 2: 12 is not prime
Inputs: 12
Expected: Not Prime
Test 3: Smallest prime
Inputs: 2
Expected: Prime
Test 4: 1 is not prime
Inputs: 1
Expected: Not Prime

Premium Question

This question needs a paid plan — upgrade, or join a class from a teacher who has one. You can read the description and sample tests, but grading is locked.

Sign in to get started