Thread: how to getting average value of array in function ,

  1. #1
    Registered User
    Join Date
    Nov 2014
    Posts
    1

    Unhappy how to getting average value of array in function ,

    Hey all guys please help me with this problem , and how to power value in function too. I hope all of you can help me . Thanks .

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    27,505
    By "getting average value of array in function" I presume you mean that you want to write a function that will compute (and return) the arithmetic mean of the values of an array. You should tell us what you have tried and explain how does it not work.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Nov 2013
    Posts
    107
    Quote Originally Posted by Veasna John View Post
    Hey all guys please help me with this problem , and how to power value in function too. I hope all of you can help me . Thanks .

    Have a look at vectors.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Array average help
    By internalbalance in forum C Programming
    Replies: 15
    Last Post: 03-24-2014, 02:08 PM
  2. Average of an Array
    By Peteski in forum C Programming
    Replies: 19
    Last Post: 01-05-2012, 04:38 PM
  3. EASY Function: Array Average
    By benjamin923 in forum C++ Programming
    Replies: 8
    Last Post: 08-03-2007, 12:36 AM
  4. average of an array
    By mrsirpoopsalot in forum C Programming
    Replies: 20
    Last Post: 09-16-2006, 04:32 PM
  5. average in an array
    By s_ny33 in forum C++ Programming
    Replies: 2
    Last Post: 04-22-2005, 01:03 PM