Heapsort is not modular
int length=0,min_heapified=0,start_length=0,index=0;


I prefer one declaration per line because it's easier to read and find the type of variables. Furthermore, min_heapified is only used inside the do-while loop, so declare it there:

do {       
    int min_heapified = 0;
    do {
...




Change 

if(x&lt;=(length-1))


to

if (x &lt; length)


It's more common and simple.



Instead of

int swap=array[left];
array[left]=array[root];
array[root]=swap;


you should create a swap function. Maybe it already exists in a library.

int swap(array, index, rootIndex) {
    int swap = array[index];
    array[index] = array[rootIndex];
    array[root] = swap;
}




If I'm right you could extract the following to a new function:

if(array[left]&lt;array[root])
{
    int swap=array[left];
    array[left]=array[root];
    array[root]=swap;
    min_heapified=1;    
}


It looks for me that the other if do the same. The only difference is the used index, so I'd write something like this:

int swapIfLess(array, index, rootIndex) {
    if (array[index] &lt; array[rootIndex]) {
        swap(array, index, rootIndex)
        return 1;   
    }
    return 0;
}




if (left &lt; length) {
    if (swapIfLess(array, left, root)) {
        min_heapified=1;    
    }
}
if (right &lt; length) {
    if (swapIfLess(array, right, root)) {
        min_heapified=1;    
    }
}




The i variable looks unnecessary:

int root=i;


Use the root variable in the for loop:

for (int root = 0; root &lt; length; root++)


Maybe you should rename it to rootIndex.



Extract more functions. The for loop (inside the do-while loops) looks as a good candidate for this. Additionally, you should have a readInputArray function and a printResults function too.