Assume that an array of integers named salarySteps that contains exactly five elements has been declared. Write a statement that assigns the value 160000 to the last element of the array salarySteps.

Respuesta :

Answer:

salarySteps[4]=160000;

Explanation:

  • An array is the collection of elements of the same data type. Its size needs to be mentioned at the time of declaration and it is declared using following syntax: data_type array_name [array_size];
  • for eg: int a[4];
  • To allocate some value to any index we can directly use its index value. The array's index starts from 0. So, if an array has 5 elements, then the index of the last element will be 4.
ACCESS MORE