To reverse a given range of numbers