BELOW , Is the code i wrote which is showing error ( that we cant use end()-1 and itr+1 operations). MY purpose is to go through the array as in pair. eg X[1 2 3] i want to