Dsa
Math
Easy
Prime Number Checker
Create a function that checks if a number n is a prime number. A prime number is defined as a number greater than 1 that has no positive divisors other than 1 and itself.
Example Input:
7
Example Output:
true
Key concepts
mathprimality testloops
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now