Given is the specific heat of water equal to 4.18 Joule per gram per *C.
This means to raise the temperature of 1 g of water by 1 degree Celsius we need 4.18 joule of energy.
Now, look at the question. We are asked that how much amount of energy would be required to raise the temperature of 25 g of water by (54-50) = 4 degree celsius.
To do so we have formula
Q = m C (temperature difference)
Have a look at pic for answer