A few problems with a simple program.

Apr 25, 2013 at 1:51am
...
Last edited on May 1, 2013 at 3:28am
Apr 25, 2013 at 1:54am
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 Apr 25, 2013 at 1:55am
Apr 25, 2013 at 6:45am
...
Last edited on May 1, 2013 at 3:28am
Topic archived. No new replies allowed.