Need some help for printing last 100 number

Here is my question.
If the input is more than 200, display on screen only the last 100 primes.
I have no idea how to do it, can anyone help?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
int Prime::find_prime(int size)
{
    int *array=new int[size];
    int counter=0;
    
    
	 for (int i=2; i<size; i++) 
        for (int j=2; j*j<=i; j++)
		    {
            if (i % j == 0) 
            break;
            else if (j+1 > sqrt(i))
            {
            	 cout<<i<<" ";
                 counter++;
                 if (counter%10==0)    //print 10 number per line
                 cout<<endl;			
            }
        }
}
what you are trying to do , you want to print the prime numbers ? or what else requirement.
Topic archived. No new replies allowed.