Reputation: 417
I wanna have an if statement that's condition is "when a float ivar is BETWEEN two numbers" something happens.
How can I do this?
Upvotes: 1
Views: 222
Reputation: 4443
float value=0.0;
if(value<=maxValue&&value>=minValue)
{
//do something
}
Upvotes: 1
Reputation: 1852
if ((your_number > lower_number) && (your_number < higher_number))
//do something...
Upvotes: 8