One number is greater than another by 4, their sum is 32. What are the two numbers? Write a function which could solve this for any two numbers (x and y) with any difference between them.​

1 answer

X+y=32
X-y=4
Add the two equation
2x=36
X=18
Put it back in any of the two equations
Y=14
DIRECT METHOD
X=(32+4)/2=18
Y=(32-4)/2=14