/* testarr02.cpp CIS 150 06/23/2005 David Klick Demonstration of array initialization. */ #include using std::cout; int main(void) { // declare and initialize array. int nums[10] = { 1, 2, 3, 4, 5 }; int i; // display array elements for (i=0; i<10; i++) { cout << nums[i] << " "; } cout << '\n'; return 0; } /* Sample output: 1 2 3 4 5 0 0 0 0 0 */