Dsa
Math
Easy
Prime Number Counter
Write a program that counts the number of prime numbers less than or equal to a given integer N. The input consists of a single integer N (1 <= N <= 10^6) and the output should be an integer representing the count of prime numbers.
Example:
Input:
10
Output:
4
Key concepts
mathprimecount
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