I have a file with the integers
17 24 3 247 -5 49
and the assignment is to read the numbers and determine if it's a prime number or not. The program's also supposed to stop when a negative value is read and display a message stating how many integers were processed.
My output is
17 is prime
24 is not prime
3 is not prime
247 is not prime
4 numbers were processed.
It would output "16 numbers were processed" but I put "- 12," so that's also an issue. How would I get the output to be correct?