m = f+4 (The number of males is four more than the number of females.)
40-f = f+4 ---> 36 = 2f ---> f = 18.
m = f+ 4 = 18+4 = 22
Hope the solution helped. Sometimes you need more than a solution. Contact fcabanski@hotmail.com for online, private tutoring, or personalized problem solving (quick for groups of problems.)