Check If Array Elements Are Consecutive In C