I created a function last week that marks true if a number is prime. Now I am trying to read from a .txt file and count the prime numbers within it.
the .txt files has numbers ranging from 2 to 10,000.
It seems I have created an infinite loop and im not really sure why. I tried to keep the function I created the same but I think im just getting caught up somewhere in the file input part.
anyways figured I would see if you guys had some suggestions.
I feel like i just forgetting something super simple here. This function now counts the prime numbers but I am having trouble just getting it to give me a total of all the times prime was true.
1 2 3 4 5 6 7 8 9 10 11
double result;
isprime(n);
{
if (result == true){
n++;
}
cout << n << endl;