You print out the wrong content. Variable b is your index and use myarray[b] to retrieve the value of each element in the array.

Code:
cout << "myarray [" << b << "] = " << myarray[b] << "\n";