Cloud computing model provides global and ondemand access to resources in a seamless manner with minimal interaction with the service provider. A typical cloud data center consists of several computational resources interconnected with each other through high-speed networks. In cloud the program execution can be visualized as a collection of multiple tasks represented by Directed Acyclic Graph (DAG) that execute in their logical sequence. Prioritization of these tasks plays an important role to achieve high performance and improved efficiency in a cloud environment. In this paper, we propose a novel task scheduling algorithm named Median Deviation based Task Scheduling (MDTS), which uses Median Absolute Deviation (MAD) of the Expected Time to Compute (ETC) of a task as a major attribute to calculate ranks of the given tasks. We use coefficient-of-variation (COV) based technique that considers task and machine heterogeneity to estimate the ETC of a particular DAG. The proposed algorithm is evaluated under various conditions using synthetic DAGs and real world applications. Our evaluation shows that the proposed MDTS algorithm produces high quality schedules and significantly reduces the makespan of an application by up to 25.01%.