Nth Prime Number Problem Statement
Find the Nth prime number given a number N.
Explanation:
A prime number is greater than 1 and is not the product of two smaller natural numbers. A prime number has exactly two distinct positive divisors: 1 and itself.
Example:
Input:
Q = 1
N = 7
Output:
17
Explanation:
The first 7 prime numbers are 2, 3, 5, 7, 11, 13, 17. Thus, the 7th prime number is 17.
Constraints:
1 <= Q <= 100
1 <= N <= 10^4
- Time Limit: 1 sec
Note:
You do not need to print anything; just implement the given function.

AnswerBot
1y
The task is to find the Nth prime number given a number N.
A prime number is a number greater than 1 that is not a product of two smaller natural numbers.
Prime numbers have only two factors - 1 and the...read more
Karnan Se
1mo
function findPrimeNumber(num){ let arr = [] let i =2 while(arr.length < num){ if(isPrime(i)){ arr.push(i) } i++ } return arr; } console.log(findPrimeNumber(10)) function isPrime(num){ for(let i=2; i<n...read more
deekshith shetty
4mo
void nthPrimeNum(int input) { int count = 0; if (input >= 1) count++; for (int i = 3 ; i < 10000; i+=2) { bool prime = true; for (int j = 2; j < i/2 ; j++) { if (i == 2 || i % j == 0) { prime = false;...read more
Add answer anonymously...
UST Senior Software Engineer interview questions & answers
A Senior Software Engineer was asked 6mo agoQ. Explain Middleware in Django.
A Senior Software Engineer was asked Q. Explain Selenium technology.
A Senior Software Engineer was asked Q. Explain the STLC procedure for testing.
Popular interview questions of Senior Software Engineer
A Senior Software Engineer was asked 6mo agoQ1. Explain Middleware in Django.
A Senior Software Engineer was asked Q2. Explain Selenium technology.
A Senior Software Engineer was asked Q3. Explain the STLC procedure for testing.
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

