Computer Science, asked by 8050119167s, 6 months ago

14. What is negative indexing? Explain with an example​

Answers

Answered by libyrodrigues2373
1

Answer:

We can access the elements of an array by going through their indexes. But no programming language allows us to use a negative index value such as -4. ... This means that the index value of -1 gives the last element, and -2 gives the second last element of an array. The negative indexing starts from where the array ends.

Explanation:

PLEASE MARK ME AS BRAINLIST AND FOLLOW ME

Answered by kush193874
3

The use of a negative integer as an array offset to access from the end of the array. Array[-3] accesses the 3rd element from the end of the array, the same as Array[ArraySize - 3]

Similar questions