Pure Programmer
Blue Matrix

Cluster Map

Project: Array Last Element

Write a program that declares an integer array and initializes it with a number of values. Then have the program print out just the last element of the array. You can not hard code the index of the last element but must determine it dynamically from the array itself. Try changing the array initializer to test out arrays of differing lengths.

$ g++ -std=c++17 ArrayLastElement.cpp -o ArrayLastElement -lfmt $ ./ArrayLastElement Array size is: 5 Last element is: 9