Computer Science, asked by swatipriya2002dbg, 8 months ago

If an array is declared as arr[]={1,3,5,7,9}; what is the value of arr[3]?

Answers

Answered by prashantrohilla32
8

Answer:

arr[3]  at index 3, element is 7

Explanation:

array index start from 0 to n.   index=i;   arr[i]

arr[0] at index 0,  element is 1

arr[1]  at index 1, element is 3

arr[2]  at index 2, element is 5

arr[3]  at index 3, element is 7

Answered by adventureisland
0

Array indices begin with 0, therefore the first element has index 0, the second has index 1, and so on. So the value of arr[3] is 7.

Declaration of an array :

  • The array is named and the type of its components are specified in an "array declaration." It can also provide the array's size in terms of elements. A variable having an array type is regarded as a pointer to the array elements' type.
  • Accessing an array element is the same as indexing an array. The index number of an array element can be used to access it. NumPy array indices begin with 0, therefore the first element has index 0, the second has index 1, and so on.
  • If an array is declared as arr[]={1,3,5,7,9};
  • value of arr[0] is 1
  • value of arr[1] is 3
  • value of arr[2] is 5
  • value of arr[3] is 7
  • value of arr[4] is  9

Similar questions