Can someone take a look at my code, I'm having errors with the end loop.
#include "stdafx.h"
#include <iostream>
using namespace std;
int area (int, int); // function prototype
int volume (int, int, int); // function prototype
int _tmain(int argc, _TCHAR* argv[])
{
int length, width, depth; // parameters for the areas and volumes
int area;
int volume;
int result;
cout << endl;
// read in the values of length, width, and depth
while (depth == 0);
{
//do something
}
cout << "If you want the result of the calculation to be an area,";
cout << endl;
cout << "place a 0 in the depth parameter ";
cout << endl << endl;
cout << "Enter a length (postive integer): ";
cin >> length;
cout << "Enter a width (postive integer): ";
cin >> width;
cout << "Enter a depth (postive integer): ";
cin >> depth;
cout << endl;
if (depth == 0) {
result = area (length, width);
cout << "With a length of " << length;
cout << " and a width of " << width;
cout << " the area is " << result << endl;
} else {
result = volume (length, width, depth);
cout << "With a length of " << length;
cout << " a width of " << width;
cout << " and a depth of " << depth;
cout << " the volume is " << result << endl;
} // end if
END LOOP;
return 0;
} // end main function
int area (int l, int w) {
int calculation;
int area (l * w);
return calculation;
} // end area function
int volume (int l, int w, int d) {
int volume (l * w * d);
return volume;
} // end volume function