#include <iostream>
using namespace std;
int main()
{
double m[3]{}, *p = m, i, min, max, sum = 0;
double average;
for (i = 0; i < 3; ++i)
{
cout << "Enter number " << i + 1 << ':';
cin >> *p;
sum += *p++;
}
for (p = m, min = max = *p++, i = 1; i < 3; ++i, ++p)
{
if (*p > max)
max = *p;
if (*p < min)
min = *p;
}
average = sum / 3;
cout << "Sum = " << sum << endl
<< "Min = " << min << endl
<< "Max = " << max << endl
<< "Average = " << average << endl;
system("pause");
}
Comments
Leave a comment