Ex 10, Chapter 5, page 253
Receiving a Variable Number of Arguments
Answers (10 and 172630728) are incorrect; they should be 42 and 473.
Count integers (6 and 9) are missing after start of brackets of 'cout' lines.
i.e.
cout<< sum(6, 2,4,6,8,10,12) <<endl;
cout<< sum(9, 11,22,33,44,55,66,77,66,99) <<endl;
(Also note, second list has 66 twice and not 88 as one might assume.)
|