Single File Programming Question
Problem Statement
Imagine you are a curious explorer named Alex, delving into the world of programming. Eager to grasp the concept of prime numbers, you embark on a coding adventure.
Your goal is to write a program that takes a number as input and reveals whether it is a prime number or not.
Note: Use nested if-else statement.
Input format
The input consists of a single integer n, representing the number to be checked for primality.
Output format
If the input number is a prime number, the output displays n is a prime number. where n is the input number.
If the input number is not a prime number, the output displays n is not a prime number. where n is the input number.
Refer to the sample output for the formatting specifications.
Code constraints
In the given scenario, the test cases fall under the following constraints:
- (2 \leq n \leq 103)
Sample test cases
Input 1:
5Output 1:
5 is a prime number.Input 2:
1000Output 2:
1000 is not a prime number.Input 3:
2Output 3:
2 is a prime number.Whitelist
Set 1:
if
Set 2:
else