954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

question about array

hi, all.
i have some problems to do array.
i am supposed to get the average and sum in given number of array.
but, i only got 1 in my all answers.
please, tell me what was wrong in my program.
thank you.

//hw for array

#include

#include

#include


using namespace std;

float ave(float x[],int n);

float sum(float x[],int n );

float diff(float x,float y);

float large(float x[],int n );

float small(float x[],int n);

const float size=10;


int main()

{


float array[10]={24.9,18.5,7.9,14.3,56.1,37.8,41.5,28.3,32.7,19.4};


cout<< "\na) \n\n";

cout<<"\naverage of these numbers: "<

sweetbaby
Newbie Poster
2 posts since Nov 2004
Reputation Points: 10
Solved Threads: 0
 

cout<<"\naverage of these numbers: "<

jasweb2002
Junior Poster in Training
56 posts since Sep 2004
Reputation Points: 11
Solved Threads: 2
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You