A few problems with a simple program.

...
Last edited on
1. Fix your cout statements. The extra "\n"s are causing your problems.
2. Use if - else if instead of multiple if statements to do multiple checks
3. change your first while loop in to a for loop
4. use a for loop to determine if the number is prime or not

Read through:
http://www.cplusplus.com/forum/beginner/98616/
Last edited on
...
Last edited on
Topic archived. No new replies allowed.