error checking help i need help asap! pleease!

i have a task to do for a ousb board just need help with some error checks
" ERROR CHECK 3: VALID NUMBER RANGE
If the data read from file contains a number beyond the range accepted by the bottom four bits of PORTB (i.e., 0-15, inclusive), the output shall be
'Y'. The program should not write this data to PORTB but should continue operating i.e., keep reading in data from the next line and writing data to
PORTB.

Examples of valid number input: 6 0 15 9 12
Examples of invalid number input: 16 -4 8.54 8v +6 127 "

how would i go about this ?
thanks in advanced
Topic archived. No new replies allowed.