SCHOOL OF CODE BUILDERS
Learn To CODE. Become A DEVELOPER.
Pages
HOME
DATA STRUCTURES
STRINGS
ARRAYS
MATRIX
BINARY TREES
LINKED LIST
STACK
QUEUE
SORTING
SEARCHING
C
PYTHON
PSEUDOCODE
CONTEST PROBLEMS
ALGORITHMS
PATTERNS
PHP
C PUZZLES
C INTERVIEW QUESTIONS
JAVA
C++
HASHING
RECURSION
BASIC C PROGRAMS
TCS-CODEVITA
FACEBOOK
CONTACT US
C program to find nth prime number in a given range
C program to find nth prime number in a given range
Input:
Enter the value of n to find nth prime:
5
Enter the range:
4 20
Output:
13
Implementation:
#include
#include
#include
#include
#include
#define MAX 1000000 int hash[MAX]={0}; void sethash(int n) { int i; for(i=1;i*n
=a && i<=b) { count++; if(count==n) { printf("%d",i); break; } } sethash(i); } } return 0; }
PREVIOUS
NEXT
HOME