function declaration question

Is there something wrong with my function declaration?

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
  
#include <iostream>
#include <iomanip>
using namespace std;

double box(int vol, double surarea); //Function Declaration goes here


int main(void)
{
	double width, len, ht, volume, surfacearea;

	cout << "Enter width, len, ht: ";
	cin >> width >> len >> ht;

	box( width, len, ht, volume, surfacearea);

	cout << fixed << setprecision(3);
	cout << "Volume is " << volume << " surface area is " << surfacearea << endl;

	return 0;
}


double box(int vol, double surarea);//First line of the function goes here
{
	vol = width * len * ht;
	surarea = 2 * width * len + 2 * width * ht + 2 * len * ht;
}
Remove the semicolon from line 25.
Topic archived. No new replies allowed.