I'm getting errors on lines 8 & 43. I can't figure out what I'm doing wrong here (besides beating my head against the desk.)
#include <iostream>
using namespace std;
{
try
{
if (num1 < 0) throw low;
if (num2 < 0) throw low;
if (num3 < 0) throw low;
if (num4 < 0) throw low;
if (num1 > 100) throw high;
if (num2 > 100) throw high;
if (num3 > 100) throw high;
if (num4 > 100) throw high;
catch (...)
{
cout << "Number out of range." << endl;
}
}
int main()
{
int num1, num2, num3, num4;
int avg;
cout << "Enter four numbers to be averaged." << endl;
cout << "\nNumbers must be between 0 and 100." << endl;
avg = (num1 + num2 + num3 + num4)/4;
cout << "The average is: " << avg << endl;
}
return 0;
}