u dont need printf and scanf to get the sum/average of n numbers.
double average (int *numbers, int n)
{
int i;
double ave = 0;
for (i=0; i%26lt;n; i++)
ave += numbers[i];
if (n %26gt; 0) return ave / n;
return 0;
}
int sum (int *numbers, int n)
{
int i;
int sum = 0;
for (i=0; i%26lt;n; i++)
sum += numbers[i];
return sum;
}
easter cards
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment