I think code is not ok

Program that displays numbers from 1 to 999 and then displays how many prime numbers are from 1 to 999. I am at beginners level so no complicated solutions.
This is what I got so far.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  #include <iostream>
//program gdje se ispisuju brojevi od 1-999 i onda se prikaze koliko ima prostih brojeva u tom rasponu
using namespace std;
int main()
{
int a, b, i;
for (i=1; i<1000; i++)
{
    cout << " " << i;
}
if (i%i)
    a=i;
{
    cout <<"\n Prime numbers are" <<a<< endl;
}
    return 0;
}
Topic archived. No new replies allowed.