int count = 0;
for (int a = 2; a < 1000; a++)
{
bool prime = true;
for (int c = 2; c*c <=a; c++)
{
if (a%c == 0)
{
prime = false;
break;
}
}
if (prime)
{
count++
}
} //end of for loop
cout << "There are " << count << " prime numbers << endl;
This is the basic idea you will want to shoot for. I did not check your logic and finding the prime numbers but this is the basic idea. You just need to add + 1 to some variable each time a prime is found and then display that number after both for loops have done their thang. Yes, I said thang.