When two bodies at different temperatures are in thermal contact with each other, thermal energy from a hot body flows…