Question bank › Math
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
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.