Old Marcus
Member
- Joined
- Sep 22, 2009
- Messages
- 6
- Programming Experience
- Beginner
Hi, I'm making a program as part of a college assignment that requires my to add up the contents of an array. Now the array has 20 places, and the only method I know of atm is:
a + b + c + d + e etc...
They are all different numbers so I can't just do a * 20, I need a more code efficient way of adding all these numbers up, is this possible?
I apologise if this has been asked before, I had a quick search but couldn't find much. If the thread already exists, I would be happy to read that without having to get you long suffering people to tell someone yet again how to do it.
And google didn't turn up anything useful either, unless I was using the wrong search terms...
a + b + c + d + e etc...
They are all different numbers so I can't just do a * 20, I need a more code efficient way of adding all these numbers up, is this possible?
I apologise if this has been asked before, I had a quick search but couldn't find much. If the thread already exists, I would be happy to read that without having to get you long suffering people to tell someone yet again how to do it.
And google didn't turn up anything useful either, unless I was using the wrong search terms...