C Program to update an array element at specified position