In this paper, we have used a streamfunction-vorticity (ψ-ξ) formulation to investigate the problem of 2-D unsteady viscous incompressible flow with heat transfer in a driven square cavity with moving top and bottom walls. We used this formulation to solve the governing equations along with no-slip and slip wall boundary conditions. A general algorithm was used for this formulation in order to compute the numerical solutions for the low Reynolds numbers Re ≤ 50. The numerical solutions of temperature are calculated for different Prandtl numbers 0.7 (for air) and 6.75 (for water). We have executed this with the aid of a computer programme developed and run in C++ compiler. We have proved the stability and convergence of the numerical scheme using matrix method. Heat transfer is studied by using the local Nusselt number. The uvelocity, v-velocity, pressure, temperature profiles along the horizontal and vertical line through geometric center of the square cavity, isotherms and isobars at different Reynolds numbers Re = 15 and 50 have been depicted.