Sorting An Array And Updating Its Corresponding Arrays From Which It Was Calculated According To It : I have 3 arrays 

> a , b ,c 

of size n.

a and b arrays are entered by the user and c is calculated as 

> c[i] = b[i] - a[i] + 1

Sorting the c array is easy but i want to make amends in a and b also such that the a [i] and b[i] corresponds to the new sorted c[i].

For Example -

> a[5] ={1 , 3 , 5 , 7 , 9 } 

> b[5] ={5 , 4 , 7 , 8 , 10 }

Then

> c[5] ={5 , 2 , 3 , 2 , 2}

Now sorting the c array, it results in 

> c[5] = { 2 , 2 , 2 , 3 , 5 }

Now i also want a and b as 

> a[5]={ 3 , 7 , 9 , 5 , 1 }

> b[5]={ 4 , 8 , 10 , 7 , 5 }

 