Five years hence:
Father's age = x+5
Son's age = y+5
Given: x+5 = 3(y+5)
That is x - 3y = 10 ....(1)
Five years ago:
Father's age = x - 5
Son's age = y - 5
Given: x - 5 = 7(y - 5)
That is x - 7y = -30 ....(2)
Solving the above equations
x = 40 and y = 10
SO, the present ages of father and son are 40 and 10