-
November 19th, 2008, 09:16 PM
#1
averaging arrays
Hey guys does anyone understand this question.
(averaging an array) write two overloaded functions that return the average of an array with the follwoing hearders:
int average(int array[], int size);
double average(double array[], int size);
use {1,2,3,4,5,6} and {6.0,4.4,1.9,2.9,3.4,3.5} to test the function
i dont know where to start!
thanks
-
November 19th, 2008, 09:32 PM
#2
Re: averaging arrays
Do you know the mathematical definition of an average?
And, just a thought, perhaps you should start like this:
Code:
int average(int array[], int size)
{
}
double average(double array[], int size)
{
}
int main()
{
int intarray[6] = {1,2,3,4,5,6};
double doublearray[6] = {6.0,4.4,1.9,2.9,3.4,3.5};
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|