There were 49 students in a gym class.if 3/7 were boys and the rest were girls, how many boys were in the gym

3/7 of 49 = 21, so there were 21 boys.

saying "the rest were girls" is redundant; what else could they be? It's just noise, put in to obfuscate the issue and try and confuse you.