Update lab2.c

This is untested, but I think this will do what he wants. Only thing to add is a way to tell how many devices there are. That way it will not post averages for all 32 devices.