I'm writing a nested loop program that determines if the inputted number is prime, I need to perform this over and over until the user inputs 0 or a negative number.

Here is what I have so far (int main code):

cout << "Please enter digits to determine if prime or not, use 0 to quit"<< endl; cin >> input; // I know not to have the user input twice, but, how can I preform a check first if the number isn't a negative or a zero? while( input != 0 && input > 0){ cin >> input; while(what expression){ // <---This is my problem?? reference below! input = input % 2; // This process and gives a 1 if the number is prime if ( input == 1) cout << "The Number is Prime" << endl; else cout << "The Number is not prime" << endl; } }

You can see where I referenced my problem(s). I'm new, just looking for help and suggestions! Thanks