Helpp!

Write a program that prompts the user to input a sequence of positive numbers to test whether
each one is prime or not. The program should display a message in this respect "Enter an integer number: ". The
program terminates when the user enters the value -1.

So the message should keep showing every time the user inputs a number, whether the number is prime or not, until the user inputs "-1".
Note: An even number is prime if it is divisible by 2.
An odd integer is prime if it is not divisible by any odd integer less than or equal to the number.



Please note, that this is not a homework site. We won't do your homework for you. The purpose of homework is that you learn by doing. However we are always willing to help solve problems you encountered, correct mistakes you made in your code and answer your questions.

We didn't see your attempts to solve this problem yourself and so we cannot correct mistakes you didn't made and answer questions you didn't ask. To get help you should do something yourself and get real problems with something. If your problem is "I don't understand a thing", then you should go back to basics and study again.

Note: An even number is prime if it is divisible by 2.
An odd integer is prime if it is not divisible by any odd integer less than or equal to the number.

Please recheck the definition of prime number. Yours is non-standard and, frankly, quite hilarious.
create a bool for prime and set some conditions. Think about the basic operators available to you
Topic archived. No new replies allowed.