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

Find the nth prime number

BackMediumPrime NumbersQ3
Find the nth prime number
Write a function to find the nth prime number. For example, the 1st prime is 2, 2nd is 3, 3rd is 5, etc.
Test Cases5 test cases

Test Cases:

Showing 2 of 3 sample test cases
Test Case 1
Input:
{
  "n": 1
}
Expected Output:
2
Test Case 2
Input:
{
  "n": 5
}
Expected Output:
11
+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