77.9k views
0 votes
Define an array of the length 6 with the elements of WORD type. Initialize the first and the last of them with the same value of your choice; leave the remaining four uninitialized.

1 Answer

4 votes

Answer:

string words[6];

words[0]="humming";

words[1]=words[0];

Step-by-step explanation:

The above statement declares an array of size 6 which can store elements of type string or word. Then I have initialized the first and second elements with the word humming and the rest of the places in the arrays are uninitialized.

You have to include the header file string so that this array could work otherwise it will not.

User Eran Machiels
by
5.0k points