Skip to main content
FREE Mock interview & resume review with Sumit. Free right now, no payment needed.Book a slot

Count prime numbers in a range

BackEasyPrime NumbersQ5
Count prime numbers in a range
Write a function to count the number of prime numbers in a given range [start, end] (inclusive).
Test Cases5 test cases

Test Cases:

Showing 2 of 3 sample test cases
Test Case 1
Input:
{
  "start": 1,
  "end": 10
}
Expected Output:
4
Test Case 2
Input:
{
  "start": 10,
  "end": 20
}
Expected Output:
4
+1 more sample test cases (will be validated when you run code)
Sign in to save your progress and mark problems as solved.
Code Editor

Loading editor...

Problem discussion

(0)

Join the discussion — login to comment and help other developers.

Login to comment