Suppose I have an Array with Length 5… I want to retrieve data from an array in order like 0,1,2,3,4,3,2,1,0,1,2 and etc…I know I can do with conditional statements but I am looking for advanced mathematical expressions like
For e.g. index = (index +1) % length – > 0,1,2,3,4,0,1,2,3,4,0,1…