Quick variable question

If I want to declare a int variable that will be used for user input. But I want to set parameters for what can be input into the variable how would I do that.

For instance:

int havingAHardTime; cannot = 0 and cannot be greater than 5
can it be negative?
ask the user again if (havingAHardTime == 0 || havingAHardTime >5)
Last edited on
Thanks for the help, thats exactly what I did I just put it in a while loop.
Topic archived. No new replies allowed.