The function checks if the array elements are consecutive If elements are consecutive , then returns true , else returns false
boolean areConsecutive ( int arr [ ] , int n ) { if ( n < 1 ) return false ;