I am having an issue. I need to check whether the user enters a digit greater than 0. If so the user needs to be reprompted. If 23409932 is entered then the 0 entered should be caught and the proper messaage displayed. Here is my code and please somebody help.
int userInput (int numberInput)
{
int index;
int remains;
cout << endl;
cout << " Enter a positive number count: ";
cin >> numberInput;
while (numberInput > 0) {
index = numberInput % 10;
if (index == 0) {
cout << " Error! Enter a positive number count: ";
cin >> numberInput;
numberInput = numberInput / 10;
}
else {
return numberInput;
}
}