So there is some positive integer k such that Ravi is 5k and Raja is 12k [so that .]
After 6 years Ravi will be 5k+6 and Raja will be 12k+6, then Solve that equation for k. Then find their ages 5k and 12k.
Subtract Raja's age MINUS Ravi's age. Edwin