// // Filename: pgm4_1b.cpp // // Description: Arrays #2, Initialzing Arrays when they are declared. // // ENSC 104: Digital Computer Programming // // Instructor: Dr. Walsh // // Section: 2 // // Date Created: 03/28/98 // Last Modified: 03/28/98 // // Name: N/A // #include #include #include const int NUM_ELEMENTS = 10; main() { // // Initializing the array when it is Declared! // char c_array[NUM_ELEMENTS] = { 'a', 'b', 'c', 'd', 'e' }; int i_array[NUM_ELEMENTS] = { 10, 9, 8, 7, 6, 5, 4, 3 }; double d_array[NUM_ELEMENTS] = { 0.123, 0.234, 0.345, 0.456, 0.567, 0.678, 0.789, 1.234 }; cout << "Dislaying Character Array Elements\n"; for( int i=0; i