Let the age of the boy be x.
Therefore the age of the father = x + 24. (The boy is 24 years younger implies that
his father is older by 24 years).
In 2 years time:
The boy will be = (x +2).
The father will be (x +24 +2) = (x + 26).
Sum of their ages = 40.
Therefore (x+2) + (x + 26) = 40.
x + x + 2 + 26 = 40
2x + 28 = 40
2x = 40 -28
2x = 12.
x = 12/2 = 6. x =6.
Present ages = x , x +24. = 6, (6 +24) = 6, 30.
Boy = 6 years old.
Father = 30 years old.
Cheers.