
Elliot W. answered 09/26/21
Experienced and Successful C Tutor
The approach you want to take is as follows.
If the number input is between 1 and 99 inclusive, it is a primary interstate. If it is odd (number % 2 == 1), it goes north/south, and if it is even (number % 2 == 0), it goes east/west.
If the number is greater than 999, it is automatically invalid.
If the number is between 100-999, check if the last two digits are equal to zero (number % 100 == 0). If so, it is invalid. Otherwise, the result of (number % 100) will be the interstate number it services, and you can use that to check if it is going north/south or east/west.