My Note about the difference between const ref and non-const ref
(1)A non-const reference may be attached only to an object of the same type...
What is the value of "val" after for's first loop?
for (int val = 1; val <= 10; ++val)
cout << val <<endl; //I...
Separate names with a comma.