Write a program to calculate and return the sum of absolute difference between the adjacent number in an array of positive integers from the position entered by the user.
A Cloth merchant has some pieces of cloth of different lengths. He has an order of curtains of length of 12 feet. He has to find how many curtains can be made from these pieces. Length of pieces of cloth is recorded in feet.