Computer Science, asked by TbiaSamishta, 11 months ago

What are upper and lower bound of an array?

Answers

Answered by vhpsharitha
1
Hey mate
Here's your answer
Each dimension in an array has an upper and lower bound, which determine the range of values that can be used as subscripts for that dimension. Array class provides us functions to get the upper and lower bound or minimum and maximum index value of an array.

When the bounds are specified in array declarators:

The lower bound is a specification expression.The upper bound is a specification expression or asterisk (*).

To get the lower bound of an array we use GetLowerBound() funtion. It takes dimention as a parameter and returns the lower bound of array.

To get the upper bound of an array we use GetUpperBound() funtion. It takes dimention as a parameter and returns the upper bound of array.

The Data array now has 30 elements, starting from Data(0), which is how you refer to the first element, up to Data(29). 0 is the lower bound of this array, and 19 is the upper bound, the lower bound of every array index is 0.

You can find the upper bound of an array with the GetUpperBound function, which makes it easy to loop over all the elements in an array using a For loop 

Hope it helped you
Pls Mark me as the brainliest
Attachments:
Answered by Sidyandex
0

An array has an upper and lower bound in every dimension.

The upper bound stands for the maximum index value that an array has, and the lower bound stands for the minimum index value, that an array has.

Both are specification expressions.

They also can be denoted by asterisks. Use GetUpperBound () Function or GetLowerBound() Function to get it.

Similar questions