Monday, May 24, 2010

Question for C programming. [Find the average of the elements in the stuff array?]?

// Something like this, you may choose float instead of int


int average=0;


int count=20; // or however many elements in the stuff array


for (int i=0;i%26lt;count;i++)


average+=stuff[i];


average/=count;


No comments:

Post a Comment