| | |
C++ : Calculating the average value of an array
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
If you are just starting, you'll probably want a loop (the STL does have a function to do [edit]summing[/edit], but I'm guessing that if you posted this question then you need to start further back). The average would be the sum divided by the total number of items.
Last edited by Dave Sinkula; Sep 10th, 2006 at 1:55 pm.
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
It would really benefit to you if you could read on some introductory material to the C++ programming language or some newbie book like "Sams Teach yourself C++ in 21 days" to get the hang of the subject.
This forum will help you definately if you get stuck in your coding attempt anytime but before that you must know the basics of the language and must have dedicated some time and research on it.
Anyways, welcome to the coding hell.
PS: Long time no see Mr. Dave. Welcome back.
This forum will help you definately if you get stuck in your coding attempt anytime but before that you must know the basics of the language and must have dedicated some time and research on it.
Anyways, welcome to the coding hell.
PS: Long time no see Mr. Dave. Welcome back.
Last edited by ~s.o.s~; Sep 10th, 2006 at 1:55 pm.
I don't accept change; I don't deserve to live.
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
![]() |
Similar Threads
- number of times each number in array occurs? (C)
- VB.NET Project Help, will pay (Software Development Job Offers)
- Help! Help!help! Help!! (C)
- calculating sum, average, highest and lowest grades (Visual Basic 4 / 5 / 6)
- help! (C++)
- Extracting Numbers (C)
- Array data not setting (C++)
- Only first out of three calculations is wrong (C++)
- Help with Error message (C++)
Other Threads in the C++ Forum
- Previous Thread: Conversion Constructor and overloaded operator= help
- Next Thread: decimal to binary conversion
Views: 5076 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for C++
6 api application array arrays based beginner binary c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete deploy developer display dll dynamiccharacterarray email encryption error file format forms fstream function functions game generator givemetehcodez graph iamthwee ifstream image input int java lib list loop looping loops map math matrix memory multiple newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg search simple sort sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






