How do I compare if a variable of integer type is between two values
How to compare if the variable is between two values, for example: variable punctuation when it is between 0 to 20
Comment
Answer by Bunny83 · Jun 20, 2019 at 09:30 AM
int min = 0;
int max = 20;
int someValue;
if (someValue >= min && someValue <= max)
{
// someValue is between min and max
}