In a thermodynamical process pressure of fixed mass of gas is changed in such a way that the gas molecules give out 30 J of heat and 10 J of work is done on the gas. If the internal energy of the gas was 40 J, the final internal energy will be:
dQ = du + dw
-30 = U