The flow and heat transfer in partially heated and partially cooled cavities were numerically analyzed. A square enclosure with a heater and a cooler on the vertical wads was considered. The size of the heater and cooler was kept constant, but the locations of the heater and cooler were changed. Using the control volume approach, a computer program based on the SIMPLE algorithm was developed. Computations were carried out to investigate Be effects of the heater and cooler locations on the fluid flow and heat transfer. It was observed that for a given cooler location, the mean Nusselt number increases as the heater moves closer to the bottom wall. On the other hand, for a given heater location, the mean Nusselt number increases as the cooler moves closer to the top horizontal wall. For the problem considered, the maximum mean Nusselt number is obtained when the heater is slightly above the bottom wall and the cooler is slightly below the top horizontal wad. For all Rayleigh numbers considered, the same behavior was observed.