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