Question about printing number

Hi, i have a question about printing number.

The print function should display the output 10 primes per line

if the input is more than 200, display on screen only the last 100 primes"

and here is my code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include <iostream>
#include <cmath>
using namespace std;

class Prime
{
	private:
		int *array;
	public:
		Prime();
		~Prime();
		int find_prime(int);
		void print_prime();
};

Prime::Prime()
{
	int y;
	int *array=new int[y];
}

Prime::~Prime()
{
	delete[]array;
}

int Prime::find_prime(int size)
{

    int *array=new int[size];
    int counter=0;
    int counter2=0;
    
	 for(int i = 1; i <=size; i++)
		{
		  if(i % 2 != 0)
          cout << i <<" ";
          
		  if(i % 2 !=0)
		  counter++;
		  if(counter%10==0)
		  cout<<endl;
	    }
    
}



void Prime::print_prime()
{
	int input;
    int choice;
    do
	{
		cout << "Enter the number in which you want to find all prime numbers up to: "<<endl;
        cin >> input;
    	find_prime(input);
    	
    	cout<<"Enter 1 to find another number or 0 to exit: "<<endl;
    	cin>>choice;
	}while(choice!=0);
	
}

int main()
{
	Prime a;
	a.print_prime();
	
	
	system("pause");
	return 0;
}
 
I have no idea how to print the last 100 number. Can anyone help?
Topic archived. No new replies allowed.