We are given this equation that needs to be solved:
In which d is the number of donuts sold and c is the number of coffee sold. We also have a condition that must be met, and is that d+c=120
Now, knowing that this condition must be met, we can start putting values into the equation and see which result they give us. Remember that these values must meet the condition. First let's say 50 coffee and 70 donuts, these values give us the following:
We have that it has to be a little less, ad because the donuts are cheaper, we can add a little bit to that number, keeping in mind that the sum of both values always has to be 120. So let's do it with 40 coffee and 80 donuts:
We have the values that we needed! See that those values satisfy both the equation and the condition we had. Therefore, 40 cups of coffee were sold