comparing elements of an array from infile

Am having problem reading from an infile and comparing how many times an element appeared in a parallel array. eg
to read an age group from an infile
age:
19
18
20
23
27
31
32
50
how do i read the ages under 20, ages from 20-29 etc..
Thanks
Topic archived. No new replies allowed.