accumulatedvalue was never declared.
A << is missing between cout and "\nThe total of th...
system("pause"; return 0; }
This is nonsensical. I suspect you meant
1 2
system("pause");
return 0; }
which might work but is still pretty bad.
Use of system is frowned upon because it asks the shell you are executing in to run some other programme for you. You have no guarantee that the other programme exists, and no guarantee that it does what you want. If someone replaces the pause command, and puts in something with the same name that wipes the hard-drive, you'd never know until you ran the programme.
cheers, for correcting my sloppy work :0. i should take my time writing it. and i know system("pause"); is bad but i use it because it's easy and i have learnt like that. but i mean it cant be that bad considering i learn from a published book soooooooooo! but thanks anyway. i will try to use getch();
it cant be that bad considering i learn from a published book
Depends on the book. At risk of starting another book-war, if it's by Schildt stop reading it and if it advised you to use system("pause"); be wary of it :)
i will try to use getch();
getch is non-standard and is not present on many systems.