OK, this is my revised function. It prints 2, then 3 5 7 all the way to 999. I see why its doing this but im absolutely clueless on how to make it print only the prime numbers. Help.
void TorF (vector<bool>& prime)
{
for (int current = 3; current < MAXSIZE; current++)
{
if...
Hi, yes i got that far, and I've been playing around with the code in that function I posted. And i can't seem to make the code work, it still prints all 1000 numbers. The 2nd "for" statement is throwing me off. I know what to do, but i can't write it in code. Sorry, i'm very new to this.
Hello, im having major problems getting my program to work. I have to list all the prime numbers from 1 to 1000. And I have to do this using a boolean vector. And i have to initialize all the numbers to true then go along and change them to false. Here's my code so far for the function that...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.