valid input range check using if else code example Example: If statement that tests if a value is in range if ((x >= xmin) && (x <= xmax)) { // something }