#include <iostream>
#include <time.h>
#include <stdlib.h>
#define SMALL 100
#define BIG 200
float read_floats( float [],
int start = 10,
int stop = 20);
int main()
{
float a[SMALL], b[BIG];
srand (time (0));
for (int i = 0; i < SMALL; i++)
a[i] = rand();
for (int i = 0; i < BIG; i++)
b[i] = rand();
cout << read_floats(a,19) << endl;
cout << read_floats(a) << endl;
cout << read_floats(a,83,94) << endl;
cout << read_floats(b,183,194) << endl;
return 1;
}
float read_floats(float a[], int start, int stop)
{ int i;
float total = 0;
cout << "Summing "
<< start
<< " to "
<< stop << " ";
for (i = start;
i <= stop;
total = total + a[i], i++);
return total;
}