with this new code I rewrote to determine if a number is prime or not, the code works. My problem is that it only runs the program once, and I want it to keep going. Any help would be appreciated on where to fix the code.
You can now see that you have a return 0; within your inner for loop. This immediately ends your program. There's other issues as well, but removing the return statement is a good start.