#includeusing namespace std; int main() { int arr[3] = {1, 2, 3}; int index = 1; int value = arr[index]; cout << "Value at index " << index << ": " << value << endl; return 0; }
#includeIn this example, we use the Standard Library `array` package to declare an integer array with three elements and then assign the value at index 2 to a variable using the Array Get function. Finally, we print the value to the console. Therefore, the Standard Library package included in these examples is either `std::` or `std::array`.#include using namespace std; int main() { array arr = {4, 5, 6}; int index = 2; int value = arr.at(index); cout << "Value at index " << index << ": " << value << endl; return 0; }