Thread: Average in arrays

  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    30

    Average in arrays

    How do you find an average of each row in a 2-dimensional array and make the last column hold the average?
    Thanks

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Here's a tip - try your assignments rather than just dumping them all on the board.
    http://cboard.cprogramming.com/showthread.php?t=80145
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Mar 2006
    Posts
    30
    It wasn't an assignment I'm trying to study and going through things I'm not sur about. I was asking for help as that is what this whole web site is about. Don't assume anything about me or why I'm asking for help. Also don't answer me if you've got noting helpful to say. Just ignore it if you don't want to answer.... obviously you have way too much time on your hands!!!

  4. #4
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    Then how about you read this announcement:
    http://cboard.cprogramming.com/annou...ouncementid=39

    And the couple of others there simply to enhance your prospect of a response. Otherwise you will be treated like a leech.
    Last edited by Dave_Sinkula; 06-16-2006 at 07:58 PM. Reason: ~leach/leech
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  5. #5
    Registered User
    Join Date
    Mar 2006
    Posts
    30
    As I Said It's Not Homework It Is Study!!!! This Isn't A Program That I Have To Do And Hand In.
    Once Again An Unhelpful And Pointless Response...

  6. #6
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    And obviously you have little since you didn't even provide us with some code that at least showed you made an effort to answer your own question. Any assesment that you are a lazy person is thus quiet... normal.

    Calm down. You type too many exclamation marks. Move that anger towards solving this array problem of yours. That's the one bugging you. If you do just that you will get answers when you next come and ask why your code isn't working. Other than that... good luck
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  7. #7
    Registered User
    Join Date
    Mar 2006
    Posts
    30
    Well thankyou for the assessment on my punctuation!!!!!!!!!!!!!!!
    But, suprise suprise, that's not really what I was looking for.

  8. #8
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Ah... alright you are right. Sorry
    You don't deserve this. Ok... so, how to find the average on that 2D array...

    An average of any given array of numbers is equal to the sum of its element values divided by the number of elements in the array.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  9. #9
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    Homework, either personal or for school, is still homework.

    Try a new thread that posts your attempt, or PM a mod to reopen this.
    Last edited by Dave_Sinkula; 06-16-2006 at 07:51 PM. Reason: Redundancy in my original edit.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 02-22-2009, 02:54 PM
  2. Moving Average Question
    By GCNDoug in forum C Programming
    Replies: 4
    Last Post: 04-23-2007, 11:05 PM
  3. Debug Error Really Quick Question
    By GCNDoug in forum C Programming
    Replies: 1
    Last Post: 04-23-2007, 12:05 PM
  4. I have a function and I need multiple averages returned
    By tommy69 in forum C++ Programming
    Replies: 20
    Last Post: 04-13-2004, 11:45 AM
  5. How can I find the average in the ARRAYS?
    By Nate2430 in forum C++ Programming
    Replies: 2
    Last Post: 11-19-2001, 11:21 AM