int arr[5]; for(int i=0; i<5; i++){ arr[i] = i+1; }
void addValue(int arr[], int index, int value){ arr[index] = value; } int main(){ int arr[5]; addValue(arr, 0, 10); addValue(arr, 4, 20); }This code creates an integer array of size 5 and adds values 10 and 20 to index 0 and 4 respectively using a function. The C++ standard library provides an array container in the