Question 1062770
Sally is x years old —>  Sam is  x+4 years old.
Also  
{{{ (x) + (x+4) = 40 }}}
{{{  2x + 4 = 40 }}}
{{{  2x = 36 }}}
{{{   x = 18 }}}  —> {{{ x+4 = 18+4 = 22 }}}

—

Ans:  Sally is {{{ highlight(18) }}}, and Sam is {{{highlight(22)}}} , years old 
        —
Check:
    18+22 = 40 (ok)
     22 = Sam's age = 18+4  (= Sally's age + 4, so also ok)