It is understood that energy supplied in the form of work can be completely converted to heat. However energy transferred in the form of heat cannot be completely obtained from the system as work. But, consider this case: A Q amount of heat is supplied isothermally to a gas confined in a piston-cylinder device. By the energy balance equation: ΔU = Q - W Since ΔU = Cv.ΔT (Cv= specific heat at constant volume, ΔT=0), ΔU = 0. Hence we get Q= W. This means all of the heat supplied to the gas was obtained as work output from the gas during its isothermal expansion. This comes as a contradiction to the fact that heat cannot be completely converted to work. Please clarify the doubt.