using namespace std;
double av(int n1, int n2, int n3)
sum = n1 + n2 + n3;
return sum / 3.0;
int n1, n2, n3;
cout << "Enter: ";
cin >> n1 >> n2 >> n3;
cout << "The average of " << n1 << " " << n2 << " " << n3
<< " is " << av(n1, n2, n3) << endl;
Plain C does not have have classes; top-level functions
like this are all there is.
They are called without a class or object name.
Main is just the function that the O/S calls to
get the program started.
Parameters are passed by value,
but we will show some variations later.