Hi... I am trying to write a function that, in short, uses info from an ID array and info from a Balance array and computes the average balance for for the Balance array. That average will be returned back to the main program. I am kinda lost right now but I will post what I have so far. Please make any suggestions you may have because I need all the help I can get!
Thank you in advance for your time!
Okay... I know its bad... but I really need help! I cant get the average and I know its a problem with my function code.Code://function to determine average balance double ave_bal(int ID [], int num_bal) { int subtotal = 0; int total; for (int j = 0; j< num_bal; j++0) { subtotal += ID [j]; } total = subtotal / num_bal; return total;
Thanks for any help!
GrlNewB