Prime Numbers in Every LanguagePublished on 01 November 2018 (Updated: 17 January 2019)
A prime number is a positive integer which is divisible only by 1 and itself. For example: 2, 3, 5, 7, 11, 13
Since every number is divisible by One so, Two is the only even and the smallest prime number.
Create a file called Prime Number using the naming convention appropriate for your language of choice.
Write a sample program which accepts an integer on the command line and outputs if the integer is a Prime number or not.
The following table contains various test cases that you can use to verify the correctness of your solution:
|Negative Case||-7||Usage: please input a non-negative integer|
|Empty Case||Usage: please input a non-negative integer|
|Small Composite Case||4||False|
|Small Prime Case||7||True|
|Large Composite Case||4011||False|
|Large Prime Case||3727||True|
- Prime Number in Python on 17 January 2019 by Haseeb Majid