Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ithprime(unsigned int input)
- {
- unsigned int count,ans,result; //storage
- unsigned int i,j;
- count=0;
- i=2;
- while(1)
- {
- for(j=2;j<=i;j++)
- {
- if(i==j)
- {
- count=count+1;
- break;
- }
- if(i%j==0)
- {
- break;//Not a prime number
- }
- }
- if(count==input)
- {
- result=i;
- break;
- }
- i++;
- }
- printf("%u\n",result);
- }
Add Comment
Please, Sign In to add comment