build error

My program does not build. any help?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 #include <iostream>
#include <iomanip>
using namespace std;


int main(void){
	srand((unsigned int)1729);  // You can change this at compile time
	const int N = 8;
	int a[N], b[N], numerator, denominator;
	double product;
	
	for (int i = 0; i < N; i++){
		a[i] = rand() % 5 + 1;
		b[i] = rand() % 10 + 1;
		cout << a[i] << "/" << b[i] << "  ";
	}
	cout << endl;
	product = multiply(a, b, N, numerator, denominator);
	cout << "The product is " << numerator << "/ " << denominator
			<< " ~= " << fixed << setprecision(4) << product << endl;
	return 0;
}


{
	prod_top = prod_bot = 1;
	for (int i = 0; i < n; i++){
		prod_top = prod_top*numers[i];
		prod_bot = prod_bot*denoms[i];
	}
	return double(prod_top) / double(prod_bot);
}
Lines 25-32: What are these lines? Is this supposed to be a function? If so, where is the function header? These lines make no sense by themselves.

Is this supposed to be the multiply function you reference on line 18? If so, you will also need a function prototype.
Topic archived. No new replies allowed.